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

No module named 'torch_cluster.graclus_cpu' #54

Closed
urialon opened this issue Mar 4, 2020 · 2 comments
Closed

No module named 'torch_cluster.graclus_cpu' #54

urialon opened this issue Mar 4, 2020 · 2 comments

Comments

@urialon
Copy link

urialon commented Mar 4, 2020

Hi @rusty1s ,
I am trying to install torch-cluster to use with torch-geometric on Mac with no gpu.
My pytorch version is 1.4.0 and I'm running inside an anaconda environment with python 3.6.10.

I installed torch_cluster, torch_sparse, torch_scatter and torch-geometric using the following lines from the installation instructions of geometric.

CUDA=cpu
pip install torch-scatter==latest+${CUDA} torch-sparse==latest+${CUDA} -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-1.4.0.html
pip install torch-cluster
pip install torch-geometric

I also modified the def spawn(self, cmd): command as explained here (before that, I had trouble installing some of the dependencies).

Installation succeeded.
I then start a python interpreter, import torch first, and then when I import torch_geometric I am getting the error that No module named 'torch_cluster.graclus_cpu' (see full log below).

I did manage to import torch_geometric when I installed torch_cluster==1.2.0 and torch_geometric==1.3.0, but this raised other problems while running the actual network.

Any idea? Thanks!

Full log:

Python 3.6.10 |Anaconda, Inc.| (default, Jan  7 2020, 15:01:53) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import torch_geometric
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/urialon/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch_geometric/__init__.py", line 2, in <module>
    import torch_geometric.nn
  File "/Users/urialon/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch_geometric/nn/__init__.py", line 2, in <module>
    from .data_parallel import DataParallel
  File "/Users/urialon/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py", line 5, in <module>
    from torch_geometric.data import Batch
  File "/Users/urialon/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch_geometric/data/__init__.py", line 6, in <module>
    from .sampler import NeighborSampler
  File "/Users/urialon/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch_geometric/data/sampler.py", line 5, in <module>
    from torch_cluster import neighbor_sampler
  File "/Users/urialon/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch_cluster/__init__.py", line 1, in <module>
    from .graclus import graclus_cluster
  File "/Users/urialon/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch_cluster/graclus.py", line 2, in <module>
    import torch_cluster.graclus_cpu
ModuleNotFoundError: No module named 'torch_cluster.graclus_cpu'
@urialon
Copy link
Author

urialon commented Mar 4, 2020

Hi again,
I tried to install pytorch-geometric using python setup.py install --cpu as you suggested here.

The --cpu flag didn't work for me, and told me that option --cpu not recognized.
When installing without the cpu flag, I am able to import torch_geometric in the interpreter, but not in pycharm, very weird...

@urialon
Copy link
Author

urialon commented Mar 4, 2020

Another update:
I created a new conda environment, this time with Python 3.7 (but I'm not sure that the 3.7 version matters), re-installed everything, and now everything seems to work!
Thanks for creating this great library :-)

@urialon urialon closed this as completed Mar 4, 2020
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