rusty1s / pytorch_scatter

PyTorch Extension Library of Optimized Scatter Operations
https://pytorch-scatter.readthedocs.io
MIT License
1.5k stars 178 forks source link

torch_scatter::cuda_version() -> int _0 with the same name and overload name multiple times #427

Closed bybeye closed 3 months ago

bybeye commented 3 months ago

I encountered an issue caused by mistakenly reinstalling the torch_scatter package using pip. Despite reinstalling all related packages, including torch_geometric, CUDA libraries, and torch, the problem persists.

Note: I had compiled the libtorchscatter.so and libtorchsparse.so and copy them into /usr/local/share.

terminate called after throwing an instance of 'c10::Error' what(): Tried to register an operator (torch_scatter::cuda_version() -> int _0) with the same name and overload name multiple times. Each overload's schema should only be registered with a single call to def(). Duplicate registration: registered by RegisterOperators. Original registration: registered by RegisterOperators Exception raised from registerDef at ../aten/src/ATen/core/dispatch/Dispatcher.cpp:207 (most recent call first): frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x57 (0x7fdd1a1ce4d7 in /home/edward/.local/lib/python3.9/site-packages/torch/lib/libc10.so) frame #1: c10::detail::torchCheckFail(char const, char const, unsigned int, std::string const&) + 0x64 (0x7fdd1a19836b in /home/edward/.local/lib/python3.9/site-packages/torch/lib/libc10.so) frame #2: c10::Dispatcher::registerDef(c10::FunctionSchema, std::string, std::vector<at::Tag, std::allocator >) + 0x3ef (0x7fdd0122ec7f in /home/edward/.local/lib/python3.9/site-packages/torch/lib/libtorchcpu.so) frame #3: c10::RegisterOperators::registerOp(c10::RegisterOperators::Options&&) + 0x2b1 (0x7fdd01277c71 in /home/edward/.local/lib/python3.9/site-packages/torch/lib/libtorchcpu.so) frame #4: c10::RegisterOperators::checkSchemaAndRegisterOp(c10::RegisterOperators::Options&&) + 0x351 (0x7fdd01279ad1 in /home/edward/.local/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so) frame #5: + 0x8821 (0x7fdc71b26821 in /home/edward/.local/lib/python3.10/site-packages/torch_scatter/_version_cpu.so) frame #6: + 0x647e (0x7fdd1a22747e in /lib64/ld-linux-x86-64.so.2) frame #7: + 0x6568 (0x7fdd1a227568 in /lib64/ld-linux-x86-64.so.2) frame #8: _dl_catch_exception + 0xe5 (0x7fdcb1efbaf5 in /lib/x86_64-linux-gnu/libc.so.6) frame #9: + 0xdff6 (0x7fdd1a22eff6 in /lib64/ld-linux-x86-64.so.2) frame #10: _dl_catch_exception + 0x88 (0x7fdcb1efba98 in /lib/x86_64-linux-gnu/libc.so.6) frame #11: + 0xe34e (0x7fdd1a22f34e in /lib64/ld-linux-x86-64.so.2) frame #12: + 0x9063c (0x7fdcb1e1763c in /lib/x86_64-linux-gnu/libc.so.6) frame #13: _dl_catch_exception + 0x88 (0x7fdcb1efba98 in /lib/x86_64-linux-gnu/libc.so.6) frame #14: _dl_catch_error + 0x33 (0x7fdcb1efbb63 in /lib/x86_64-linux-gnu/libc.so.6) frame #15: + 0x9012e (0x7fdcb1e1712e in /lib/x86_64-linux-gnu/libc.so.6) frame #16: dlopen + 0x48 (0x7fdcb1e176c8 in /lib/x86_64-linux-gnu/libc.so.6) frame #17: + 0x15001 (0x7fdcb0ec1001 in /usr/lib/python3.10/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so)

bybeye commented 3 months ago

Sorry for forgetting the package information.

System WSL Ubuntu 22.04.3 LTS python 3.9.18 torch 2.0.1+cu118 torch-cluster 1.6.3+pt20cu118 torch_geometric 2.3.1 torch-scatter 2.1.2+pt20cu118 torch-sparse 0.6.18+pt20cu118 torch-spline-conv 1.2.2+pt20cu118 torchaudio 2.0.2 torchvision 0.15.2 pybind11 2.11.1

bybeye commented 3 months ago

I discovered the problem by installing torch-scatter with pip and loading scatterlib.so with C++. I also use pybind to import Python modules in C++, which may cause this problem.