Closed Zahra-Bakhtiari closed 2 years ago
Hi! Thanks for the PR! Could you elaborate on what is the import error? I think people just need to install some prerequisites (torch
, rdkit
, torch-geometric
, dgl
) before using ogb
. I try to print fewer errors because some package is not necessary for some users (dgl
is not necessary for PyG users, rdkit
is not necessary for non-molecule graph datasets)
Without logs users are getting just below error:
with the changes in this PR import is successful for both:
these 2 lines are causing import issues:
from torch_geometric.data import InMemoryDataset noqa pylint: disable from ogb.io.read_graph_pyg import read_graph_pyg
it looks like InMemoryDataset is not actively being used anywhere in the file so it can get converted to object.
In addition the below line in init also causes import issue:
TODO: The below line causes import issue for "from ogb.graphproppred import PygGraphPropPredDataset" and is not being used anywhere else self.data, self.slices = torch.load(self.processed_paths[0])
Did you install torch-geometric? In order to use PyGGraphPropDataset, you need to have pyg.
yes, this is the screenshot of my virtualenv:
can you successfully do the following?
from torch_geometric.data import InMemoryDataset
It's likely that your torch_geometric is not installed properly.
the installation looks fine but the import provides this error:
I see. You need to install torch_sparse correctly. See https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html
Hi I am able to run from torch_geometric.data import InMemoryDataset
successfully. But whenever I try to import anything from ogb, the program stuck for infinite time. Import code is: from ogb.graphproppred import Evaluator
I followed the following command to install torch in conda environment:
CUDA=cu113
TORCH=1.11.0
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-geometric
Please see my reply in https://github.com/snap-stanford/ogb/issues/322#issuecomment-1104761589.
Did you find any solution for this issue? I'm facing the same issue while importing from ogb.graphproppred. It's taking infinite time to import
Did you find any solution for this issue? I'm facing the same issue while importing from ogb.graphproppred. It's taking infinite time to import
I fix this problem by calling import sklearn
at first, sinceogb.graphproppred.evaluate.py
callsfrom sklearn.metrics import ...
In my case, it is an issue with sklearn
.
Import sklearn before also solve my problem. Thanks! @Qitong-Wang !
The ogb package can not be imported on console now and will generate errors for the below imports:
import torch import ogb from ogb.graphproppred import GraphPropPredDataset from ogb.graphproppred import PygGraphPropPredDataset
In addition log generation is not implemented in init files. I also noticed that the lines in init that blocks proper import have not yet been used anywhere else in the program so I have a PR to address these issues.
https://github.com/Zahra-Bakhtiari/GraphPropPred_bug_fix/pull/1/files
I also did some google search and noticed that this is a big struggle for the new ogb users, several open issues exist on it :)