Graph input (networkx) for Dataloader in Pytorch

Viewed 509

I am newbie in Graph using Deep learning. I'm trying to create DataLoader for Pytorch to training.

I using networkx to save my graph, then get dataset from util of torch_geometric to have dataset for DataLoader. But I can not train my model. My code:

#import...
G = nx.karate_club_graph()
dataset = torch_geometric.utils.from_networkx(G)
dataloader = DataLoader(dataset=dataset, batch_size=32, shuffle=True)

for data in dataloader:
   print(data) # Error here: TypeError: getattr(): attribute name must be string

So how do I put Graph Input for Pytorch to train?

0 Answers
Related