'method' object is not iterable #5889
Replies: 4 comments 7 replies
-
Can you put in that section of code? |
Beta Was this translation helpful? Give feedback.
-
Hi, It is just crashing at the step of loading the database import os.path as osp from torch_geometric.datasets import PPI path = osp.join(osp.dirname(osp.realpath(file)), '..', 'data', 'PPI') |
Beta Was this translation helpful? Give feedback.
-
Hi, I got the same problem but with networkx==2.8.7, and I just found this discussion. My error code snippet: # see https://github.com/sungyongs/dpgn/blob/master/utils.py
def decompose_graph(graph):
# graph: torch_geometric.data.data.Data
# TODO: make it more robust
x, edge_index, edge_attr, global_attr = None, None, None, None
for key in graph.keys:
if key=="x":
x = graph.x
elif key=="edge_index":
edge_index = graph.edge_index
elif key=="edge_attr":
edge_attr = graph.edge_attr
elif key=="global_attr":
global_attr = graph.global_attr
else:
pass
return (x, edge_index, edge_attr, global_attr) where the line |
Beta Was this translation helpful? Give feedback.
-
My problem has been solved, just add a(). |
Beta Was this translation helpful? Give feedback.
-
I am getting below error while using pytorch_geometric to train the PPI database.
Traceback (most recent call last):
File "PPI_GAT_GD.py", line 20, in
train_dataset = PPI(path, split='train')
File "/lib/python3.8/site-packages/torch_geometric/datasets/ppi.py", line 67, in init
super().init(root, transform, pre_transform, pre_filter)
File "/lib/python3.8/site-packages/torch_geometric/data/in_memory_dataset.py", line 50, in init
super().init(root, transform, pre_transform, pre_filter)
File "/lib/python3.8/site-packages/torch_geometric/data/dataset.py", line 87, in init
self._process()
File "//lib/python3.8/site-packages/torch_geometric/data/dataset.py", line 170, in _process
self.process()
File "/lib/python3.8/site-packages/torch_geometric/datasets/ppi.py", line 116, in process
edge_index = torch.tensor(list(G_s.edges)).t().contiguous()
TypeError: 'method' object is not iterable
Version Used:
torch-cluster 1.6.0
torch-geometric 2.0.4
torch-scatter 2.0.9
torch 1.11.0
Beta Was this translation helpful? Give feedback.
All reactions