Git Product home page Git Product logo

Comments (15)

lihua213 avatar lihua213 commented on June 27, 2024 19

The error can be solved by "import torch" first!
for example:
import torch
from torch_sparse import spspmm

from pytorch_scatter.

kwohlfahrt avatar kwohlfahrt commented on June 27, 2024 11

I had this problem on Linux (Travis-CI actually) today, and it was solved by clearing the pip cache. Just leaving a note here on the off chance somebody else runs into this issue.

from pytorch_scatter.

qianwenyuan avatar qianwenyuan commented on June 27, 2024 5

@kwohlfahrt can you tell me how to clear pip cache in linux ubuntu?
rm -r ~/.cache/pip/
i just deleted pip cache, and reinstall torch_scatter. The problem was solved.

from pytorch_scatter.

w4nderlust avatar w4nderlust commented on June 27, 2024 4

I'm having the same problem on ubuntu 18.04, clearing the cache doesn't seem to help:

...
    import torch_geometric.transforms as T
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/transforms/__init__.py", line 8, in <module>
    from .point_pair_features import PointPairFeatures
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/transforms/point_pair_features.py", line 2, in <module>
    from torch_geometric.nn.conv.ppf_conv import point_pair_features
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/nn/__init__.py", line 2, in <module>
    from .data_parallel import DataParallel
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py", line 5, in <module>
    from torch_geometric.data import Batch
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/data/__init__.py", line 1, in <module>
    from .data import Data
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/data/data.py", line 4, in <module>
    from torch_geometric.utils import (contains_isolated_nodes,
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/utils/__init__.py", line 4, in <module>
    from .dropout import dropout_adj
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_geometric/utils/dropout.py", line 2, in <module>
    from torch_sparse import coalesce
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_sparse/__init__.py", line 2, in <module>
    from .coalesce import coalesce
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_sparse/coalesce.py", line 4, in <module>
    from .utils.unique import unique
  File "/home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_sparse/utils/unique.py", line 5, in <module>
    import torch_sparse.unique_cuda
ImportError: /home/piero/dev/meta-graph/mgvenv/lib/python3.6/site-packages/torch_sparse/unique_cuda.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

from pytorch_scatter.

rusty1s avatar rusty1s commented on June 27, 2024 2

Your installation suggests that it does not recompile the kernels and is using a cached version instead. Please uninstall the packages first before reinstalling them:

pip uninstall torch-scatter torch-sparse

Run this command multiple times.

from pytorch_scatter.

w4nderlust avatar w4nderlust commented on June 27, 2024 1

Unfortunately I doubt it's a CUDA related issue, as I'm trying to run the same code from a Mac laptop without CUDA and get the same error:

Traceback (most recent call last):
  File "main.py", line 8, in <module>
    from data import load_dataset
  File "/Users/piero/Development/mgraph/mgraph/data.py", line 8, in <module>
    import torch_geometric.transforms as T
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_geometric/__init__.py", line 2, in <module>
    import torch_geometric.nn
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_geometric/nn/__init__.py", line 2, in <module>
    from .data_parallel import DataParallel
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_geometric/nn/data_parallel.py", line 5, in <module>
    from torch_geometric.data import Batch
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_geometric/data/__init__.py", line 1, in <module>
    from .data import Data
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_geometric/data/data.py", line 7, in <module>
    from torch_sparse import coalesce
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_sparse/__init__.py", line 2, in <module>
    from .coalesce import coalesce
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_sparse/coalesce.py", line 2, in <module>
    import torch_scatter
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_scatter/__init__.py", line 3, in <module>
    from .mul import scatter_mul
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_scatter/mul.py", line 3, in <module>
    from torch_scatter.utils.ext import get_func
  File "/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_scatter/utils/ext.py", line 2, in <module>
    import torch_scatter.scatter_cpu
ImportError: dlopen(/Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_scatter/scatter_cpu.cpython-37m-darwin.so, 2): Symbol not found: __ZN6caffe26detail37_typeMetaDataInstance_preallocated_29E
  Referenced from: /Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_scatter/scatter_cpu.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Users/piero/Development/mgraph/mgvenv/lib/python3.7/site-packages/torch_scatter/scatter_cpu.cpython-37m-darwin.so

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

If it is helpful, the python version is 3.7.3

Attatching the log for the installation of torch-sparse on MacOS:
log.txt

from pytorch_scatter.

rusty1s avatar rusty1s commented on June 27, 2024

Related to pyg-team/pytorch_geometric#18.

from pytorch_scatter.

seanie12 avatar seanie12 commented on June 27, 2024

@kwohlfahrt can you tell me how to clear pip cache in linux ubuntu?

from pytorch_scatter.

rusty1s avatar rusty1s commented on June 27, 2024

Can you show me the installation log of torch-sparse? This also might indicate a mismatch of CUDA versions, so you should check this.

from pytorch_scatter.

w4nderlust avatar w4nderlust commented on June 27, 2024

Did it several time, also using --no-cache, and also recreating a new environment. Had no luck unfortunately.

from pytorch_scatter.

rusty1s avatar rusty1s commented on June 27, 2024

Which gcc version are you using?

from pytorch_scatter.

w4nderlust avatar w4nderlust commented on June 27, 2024
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

from pytorch_scatter.

rusty1s avatar rusty1s commented on June 27, 2024

To be honest, I do not really know. macOS installation should run fine following pyg-team/pytorch_geometric#18 (comment) and https://twitter.com/xbresson/status/1154686843130011649?s=21. For Ubuntu, your error message sounds CUDA related, as it finds scatter_cpu, but not scatter_cuda.

from pytorch_scatter.

w4nderlust avatar w4nderlust commented on June 27, 2024

Not using conda unfortunately, both mac and ubuntu.
The version of gcc under ubuntu is 7.4.0 by the way, and cuda is 10.1
Anyway, thank you for your help, much appreciated.

from pytorch_scatter.

q1221sr avatar q1221sr commented on June 27, 2024

import torch
from torch_scatter import scatter_max
Traceback (most recent call last):
File "", line 1, in
File "/home/ahyun/anaconda3/envs/py36torch040/lib/python3.6/site-packages/torch_scatter/init.py", line 3, in
from .mul import scatter_mul
File "/home/ahyun/anaconda3/envs/py36torch040/lib/python3.6/site-packages/torch_scatter/mul.py", line 3, in
from torch_scatter.utils.ext import get_func
File "/home/ahyun/anaconda3/envs/py36torch040/lib/python3.6/site-packages/torch_scatter/utils/ext.py", line 2, in
import scatter_cpu
ImportError: /home/ahyun/anaconda3/envs/py36torch040/lib/python3.6/site-packages/scatter_cpu.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at6detail20DynamicCUDAInterface10set_deviceE

I tried install w/ both pytorch v 0.4.0 and 0.4.1, via pip and source and get the same error How do I resolve this issue?

hey, guys
just do it in your conda env!

pip uninstall torch-sparse
pip install torch-sparse==0.6.0

not 0.6.12!

from pytorch_scatter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.