question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'NoneType' object has no attribute 'origin'

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
rusty1scommented, Apr 23, 2021

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-index option, i.e.

pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+{CUDA}.html
6reactions
fedebotucommented, Apr 21, 2021

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:

  1. Update CUDA to the latest version. NOTE: if you encounter problems with the CUDA installation, follow this solution (basically purge the Nvidia drivers and reinstall them so to avoid problems with dependencies)
  2. Install latest version of torch with cuda by running this (from PyTorch webpage)
pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
  1. Install torch-geometric and its dependencies this in your terminal (from the PyTorch Geometric installation guide):
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-geometric
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get AttributeError: 'NoneType' object has no attribute ...
NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None .
Read more >
artifact: AttributeError: 'NoneType' object has no attribute 'origin'
+++ This bug was initially created as a clone of Bug #1311431 +++ I believe Bug 1296530 is causing bustage with artifact builds...
Read more >
'NoneType' object has no attribute 'origin' - Kaggle
'NoneType' object has no attribute 'origin' ... hello, I'm trying to run this short program but an error showes up. this is the...
Read more >
AttributeError: 'NoneType' object has no attribute 'X' | bobbyhadz
The Python "AttributeError: 'NoneType' object has no attribute" occurs when we try to access an attribute on a None value, e.g. assignment from...
Read more >
'NoneType' object has no attribute 'values' (Odoo 13)
AttributeError means that there was an Error that had to do with an Attribute request. In general, when you write x.y, y is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found