Convert a NetworkX graph into a PyTorch Geometric Heterogeneous Graph #4457
Unanswered
negarmaleki96
asked this question in
Q&A
Replies: 1 comment 4 replies
-
The data format of heterogeneous graphs in PyG and networkx differ, so it is difficult to implement a general solution to convert a networkx graph into a PyG heterogeneous graph. I personally think the best solution is to do the conversion manually (happy to take any feedback though on how you think this can be achieved). For your text data, you would need to embed them first, e.g., via the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I created a heterogeneous directed graph in NetworkX, and now, for applying GNN models, I think I should convert it into a PyTorch Geometric Heterogeneous Graph. I used "pyg_graph = from_networkx(myG)", but as nodes' attributes are not the same, I got the following error: "ValueError: Not all nodes contain the same attributes"
How can I convert my NetworkX graph into a PyTorch Geometric Heterogeneous Graph? (Also, I have to mention that my attributes are a mix of text and numeric values)
Beta Was this translation helpful? Give feedback.
All reactions