pytorch_sparse: AttributeError: 'NoneType' object has no attribute 'origin'
I am using torch-sparse version 0.6.8 as a dependency for a project I am working on.
However, I get the following error inside the torch_sparse/__init__.py file:
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
AttributeError: 'NoneType' object has no attribute 'origin'
It seems that the find_spec() call returns None.
I am running on CUDA on Ubuntu and using torch version 1.7.1 and torch-scatter version 2.0.5 Do you know how I can resolve this error?
Thanks
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 22 (6 by maintainers)
Did you install the CUDA package, e.g. via
https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html? Otherwise, you may try to install with the--no-indexoption, i.e.I will leave my 50 cents here, I tried other methods to solve this problem but then but just got other issues 😅 I solved them by updating to PyTorch 1.8.1 and CUDA to 11.1 (using Ubuntu 20.04). Here are the steps:
torchwithcudaby running this (from PyTorch webpage)torch-geometricand its dependencies this in your terminal (from the PyTorch Geometric installation guide):This issue has not been solved.
I met the same problem and fixed it by installing cuda package. Check if ‘/usr/local/cuda-11.x’ is existing. If you only install ‘cuda toolkit’ in conda virtual env, you can’t find it. (refer to below explanation)
My solution is:
There is also a PyTorch conda package in
conda-forgewhich is picked up (rather than the one from the-c pytorchchannel). Swapping the order of channels, i.e., puttingpytorchbeforeconda-forge, should fix this.