I have a weighted graph stored in Data object, and I want to convert this graph to Networkx MultiGraph. Here is what I have tried:
data = Data(x=x, edge_index=edge_index) print(edge_index).
from torch_geometric.utils import to_networkx, from_networkx G=to_networkx(data, to_undirected=True)
ValueError: too many values to unpack (expected 2)
G = nx.MultiGraph() edges = data.edge_index.numpy() edge_list =  for i in range(data.num_edges): edge_list.append(tuple(edges[:, i])) G.add_edges_from(edge_list) data.G = G adj=nx.adjacency_matrix(G) print('here the adj is', adj.shape)
Result=(18, 18) expected (23,23)
What else can I do? Thank you very much for your Input