Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import issue #22

Open
yousshark opened this issue Jun 10, 2024 · 1 comment
Open

import issue #22

yousshark opened this issue Jun 10, 2024 · 1 comment

Comments

@yousshark
Copy link

Error message indicating that there is a circular import issue in the fastgraphml package, specifically with the DMGI model.
Note : Circular imports occur when two or more modules depend on each other directly or indirectly, causing an import loop.

@yousshark
Copy link
Author

`---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in <cell line: 2>()
1 import torch
----> 2 from fastgraphml.graph_embeddings import DMGI, GAT, SAGE, METAPATH2VEC

2 frames
/usr/local/lib/python3.10/dist-packages/fastgraphml/init.py in
1 from arango_datasets.datasets import Datasets
2
----> 3 from fastgraphml.graph_embeddings.models.dmgi import DMGI
4 from fastgraphml.graph_embeddings.models.gat import GAT
5 from fastgraphml.graph_embeddings.models.graph_sage import SAGE

/usr/local/lib/python3.10/dist-packages/fastgraphml/graph_embeddings/models/dmgi.py in
11 from torch_geometric.typing import Adj, EdgeType, OptPairTensor
12
---> 13 from ..utils import GraphUtils
14
15 # check for gpu

/usr/local/lib/python3.10/dist-packages/fastgraphml/graph_embeddings/init.py in
----> 1 from fastgraphml.graph_embeddings.models.dmgi import DMGI
2 from fastgraphml.graph_embeddings.models.gat import GAT
3 from fastgraphml.graph_embeddings.models.graph_sage import SAGE
4 from fastgraphml.graph_embeddings.models.metapath2vec import METAPATH2VEC
5

ImportError: cannot import name 'DMGI' from partially initialized module 'fastgraphml.graph_embeddings.models.dmgi' (most likely due to a circular import) (/usr/local/lib/python3.10/dist-packages/fastgraphml/graph_embeddings/models/dmgi.py)`

yousshark added a commit to yousshark/fastgraphml that referenced this issue Jun 10, 2024
…imports within functions to delay the import and avoid circular dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant