You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
May I seek for your advice regarding to following issue:
/workspace/conda-env/lib/python3.8/site-packages/torch_geometric/utils/convert.py in from_networkx(G, group_node_attrs, group_edge_attrs)
190 else:
191 try:
--> 192 data[key] = torch.tensor(value)
193 except ValueError:
194 pass
TypeError: new(): invalid data type 'str'
when the below code is run:
`import torch
from torch_geometric.data import Data
from torch_geometric.utils import erdos_renyi_graph, to_networkx, from_networkx
edge_index = erdos_renyi_graph(50, edge_prob=0.2)
x = torch.randn(50, 64)
edge_attr = torch.randn(edge_index.size(1), 32)
data = Data(edge_index=edge_index, x=x, edge_attr=edge_attr)
print(data)
G = to_networkx(data, node_attrs=['x'], edge_attrs=['edge_attr'])
data = from_networkx(G)
print(data)`
There is no such kind of issue when the code run in another OS system.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions