pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.33k stars 3.66k forks source link

run example cora error #117

Closed fuxianh closed 5 years ago

fuxianh commented 5 years ago

ModuleNotFoundError: No module named 'unique_cuda'

Since my pytorch version is 1.0.0. I cannot install torch-unique with pip, it gives me error, seems didn't support 1.0.0, which confuses me a lot.

rusty1s commented 5 years ago

Hi, this seems to be an error with the installation of torch-sparse (which also comes with an unique kernel for faster coalescing). torch-unique is definitively not needed anymore. Can you run the test suite of torch-sparse?

rusty1s commented 5 years ago

I created a FAQ for common installation errors. Let me know if this fixes your issues.

rusty1s commented 5 years ago

Closed due to inactivity. Feel free to reopen.

patilaum commented 5 years ago

Got the same error when I ran allennlp train train_configs/defaults.jsonnet -s experiments/name_of_experiment --include-package dataset_readers.spider --include-package models.semantic_parsing.spider_parser from repo https://github.com/benbogin/spider-schema-gnn.git

following are the logs

2019-08-19 18:46:32,077 - INFO - pytorch_pretrained_bert.modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex . 2019-08-19 18:46:32,480 - INFO - pytorch_transformers.modeling_bert - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex . 2019-08-19 18:46:32,483 - INFO - pytorch_transformers.modeling_xlnet - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex . Traceback (most recent call last): File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/bin/allennlp", line 11, in <module> load_entry_point('allennlp===0.8.5-unreleased', 'console_scripts', 'allennlp')() File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/allennlp-0.8.5_unreleased-py3.6.egg/allennlp/run.py", line 18, in run main(prog="allennlp") File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/allennlp-0.8.5_unreleased-py3.6.egg/allennlp/commands/__init__.py", line 101, in main import_submodules(package_name) File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/allennlp-0.8.5_unreleased-py3.6.egg/allennlp/common/util.py", line 323, in import_submodules module = importlib.import_module(package_name) File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "./models/semantic_parsing/__init__.py", line 1, in <module> from models.semantic_parsing.spider_parser import SpiderParser File "./models/semantic_parsing/spider_parser.py", line 18, in <module> from torch_geometric.data import Data, Batch File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/__init__.py", line 2, in <module> import torch_geometric.nn File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/nn/__init__.py", line 2, in <module> from .data_parallel import DataParallel File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py", line 5, in <module> from torch_geometric.data import Batch File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/data/__init__.py", line 1, in <module> from .data import Data File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/data/data.py", line 7, in <module> from torch_sparse import coalesce File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_sparse/__init__.py", line 1, in <module> from .coalesce import coalesce File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_sparse/coalesce.py", line 4, in <module> from .utils.unique import unique File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_sparse/utils/unique.py", line 5, in <module> import unique_cuda ModuleNotFoundError: No module named 'unique_cuda'

patilaum commented 5 years ago

I got the above error when I install torch_sparse==0.2.1

Got the following error when I installed torch_sparse>=0.2.2

Traceback (most recent call last): File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/bin/allennlp", line 11, in load_entry_point('allennlp===0.8.5-unreleased', 'console_scripts', 'allennlp')() File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/allennlp-0.8.5_unreleased-py3.6.egg/allennlp/run.py", line 18, in run main(prog="allennlp") File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/allennlp-0.8.5_unreleased-py3.6.egg/allennlp/commands/init.py", line 101, in main import_submodules(package_name) File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/allennlp-0.8.5_unreleased-py3.6.egg/allennlp/common/util.py", line 323, in import_submodules module = importlib.import_module(package_name) File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 941, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "./models/semantic_parsing/init.py", line 1, in from models.semantic_parsing.spider_parser import SpiderParser File "./models/semantic_parsing/spider_parser.py", line 18, in from torch_geometric.data import Data, Batch File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/init.py", line 2, in import torch_geometric.nn File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/nn/init.py", line 2, in from .data_parallel import DataParallel File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py", line 5, in from torch_geometric.data import Batch File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/data/init.py", line 6, in from .sampler import NeighborSampler File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_geometric/data/sampler.py", line 4, in from torch_cluster import neighbor_sampler File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_cluster/init.py", line 1, in from .graclus import graclus_cluster File "/home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_cluster/graclus.py", line 2, in import torch_cluster.graclus_cpu ImportError: /home/aum/IMBS/text2sql/spider-schema-gnn-master/alle/lib/python3.6/site-packages/torch_cluster/graclus_cpu.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c1019UndefinedTensorImpl10_singletonE

rusty1s commented 5 years ago

You should try downgrading gcc to 5.4.

patilaum commented 5 years ago

My gcc version is already 5.4.0 here's the log when I ran gcc --version

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

rusty1s commented 5 years ago

Mh, eventually those threads may help you: https://github.com/open-mmlab/mmdetection/issues/728#issuecomment-497232980 and https://github.com/facebookresearch/maskrcnn-benchmark/issues/223

patilaum commented 5 years ago

Issue is still not getting solved. Some threads say the problem is because of incompatible pytorch version which some say it is because of cuda version. I uninstalled and reinstalled pytorch and torchvision with cuda 10 and others being pillow-6.1.0 torch-1.2.0 torchvision-0.4.0

But still the problem persists. Please help.

rusty1s commented 5 years ago

Please see my message here https://github.com/rusty1s/pytorch_geometric/issues/632#issuecomment-523129293.