SHI-Labs / Neighborhood-Attention-Transformer

Neighborhood Attention Transformer, arxiv 2022 / CVPR 2023. Dilated Neighborhood Attention Transformer, arxiv 2022
MIT License
1.05k stars 86 forks source link

nattenav_cuda.so: cannot open shared object file: No such file or directory #22

Closed julliffbistu closed 2 years ago

julliffbistu commented 2 years ago

can you help me ?

module = importlib.util.module_from_spec(spec)

File "", line 583, in module_from_spec File "", line 1043, in create_module File "", line 219, in _call_with_frames_removed ImportError: /home/zhulifu/.cache/torch_extensions/py37_cu113/nattenav_cuda/nattenav_cuda.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/media/DATA/zhulifu/bin/Neighborhood-Attention-Transformer-main/detection/cuda/natten.py", line 15, in import nattenav_cuda ModuleNotFoundError: No module named 'nattenav_cuda'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "cuda/gradcheck.py", line 1, in from natten import NATTENAVFunction, NATTENQKRPBFunction File "/media/DATA/zhulifu/bin/Neighborhood-Attention-Transformer-main/detection/cuda/natten.py", line 19, in raise RuntimeError("Could not load NATTEN CUDA extension. " + RuntimeError: Could not load NATTEN CUDA extension. Please make sure your device has CUDA, the CUDA toolkit for PyTorch is installed, and that you've compiled NATTEN correctly.

alihassanijr commented 2 years ago

Hello and thank you for your interest. Are you sure you've installed all the requirements? It looks like the ninja build is failing, therefore it's falling back to loading the precompiled version which doesn't exist because it hasn't been set up. Could you share your environment details and the command you're running?

julliffbistu commented 2 years ago

thanks very much! when i install the requirments. errors such as: Neighborhood-Attention-Transformer-main/detection$ pip install -r requirements.txt Looking in links: https://download.pytorch.org/whl/cu113/torch_stable.html, https://download.pytorch.org/whl/cu113/torch_stable.html, https://download.openmmlab.com/mmcv/dist/cu113/torch1.11.0/index.html Collecting git+https://github.com/rwightman/pytorch-image-models.git@9d6aad44f8fd32e89e5cca503efe3ada5071cc2a (from -r requirements.txt (line 8)) Cloning https://github.com/rwightman/pytorch-image-models.git (to revision 9d6aad44f8fd32e89e5cca503efe3ada5071cc2a) to /tmp/pip-req-build-2o_gu3ug Running command git clone --filter=blob:none --quiet https://github.com/rwightman/pytorch-image-models.git /tmp/pip-req-build-2o_gu3ug fatal: unable to access 'https://github.com/rwightman/pytorch-image-models.git/': GnuTLS recv error (-54): Error in the pull function. warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD'

error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/rwightman/pytorch-image-models.git /tmp/pip-req-build-2o_gu3ug did not run successfully. │ exit code: 128 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/rwightman/pytorch-image-models.git /tmp/pip-req-build-2o_gu3ug did not run successfully. │ exit code: 128 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

julliffbistu commented 2 years ago

my pip list: addict 2.4.0 attrs 21.4.0 certifi 2021.10.8 charset-normalizer 2.0.12 cmake 3.22.4 coverage 6.3.2 cycler 0.11.0 Cython 0.29.28 flatbuffers 2.0 fonttools 4.33.2 fvcore 0.1.5.post20220305 idna 3.3 importlib-metadata 4.11.3 iniconfig 1.1.1 iopath 0.1.9 kiwisolver 1.4.2 lmdb 1.3.0 matplotlib 3.5.1 mmcv 1.4.8 /media/DATA/zhulifu/bin/Neighborhood-Attention-Transformer-main/detection/mmcv-1.4.8 mmcv-full 1.4.8 mmdet 2.19.0 ninja 1.10.2.3 numpy 1.21.6 onnx 1.7.0 onnxoptimizer 0.2.6 onnxruntime 1.11.0 opencv-python 4.5.5.64 packaging 21.3 Pillow 9.1.0 pip 22.0.4 pluggy 1.0.0 portalocker 2.4.0 protobuf 3.20.1 py 1.11.0 pycocotools 2.0.4 pyparsing 3.0.8 pytest 7.1.2 pytest-runner 6.0.0 python-dateutil 2.8.2 python-dotenv 0.20.0 PyTurboJPEG 1.6.6 PyYAML 6.0 requests 2.27.1 scipy 1.7.3 setuptools 62.1.0 six 1.16.0 tabulate 0.8.9 termcolor 1.1.0 terminaltables 3.1.10 tifffile 2021.11.2 timm 0.5.0 tomli 2.0.1 torch 1.11.0+cu113 torchvision 0.12.0+cu113 tqdm 4.64.0 typing_extensions 4.2.0 urllib3 1.26.9 wheel 0.37.1 yacs 0.1.8 yapf 0.32.0 zipp 3.8.0

julliffbistu commented 2 years ago

when I cd cuda file and use python3 setup.py install an error ecured: cuda/build/temp.linux-x86_64-cpython-37/nattenav_cuda_kernel.o: No such file or directory

julliffbistu commented 2 years ago

Hello and thank you for your interest. Are you sure you've installed all the requirements? It looks like the ninja build is failing, therefore it's falling back to loading the precompiled version which doesn't exist because it hasn't been set up. Could you share your environment details and the command you're running?

alihassanijr commented 2 years ago

Was your issue resolved?

julliffbistu commented 2 years ago

Was your issue resolved?

no can you help me ? thank you very much

alihassanijr commented 2 years ago

Could you share the full error when you try python setup.py install? Also, what was the command that resulted in the first error you shared?

stevenwalton commented 2 years ago

When a torch extension is properly built it should show up in your cache. The ninja build instructions show up here as well. That's ~/.cache/torch_extensions/natten_cuda. Does the ninja file show up? You should also see two .o files and a .so file here.

alihassanijr commented 2 years ago

Closing this due to inactivity. If you still have questions feel free to open it back up.

YechengLiang commented 2 years ago

can you help me ?

module = importlib.util.module_from_spec(spec)

File "", line 583, in module_from_spec File "", line 1043, in create_module File "", line 219, in _call_with_frames_removed ImportError: /home/zhulifu/.cache/torch_extensions/py37_cu113/nattenav_cuda/nattenav_cuda.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/media/DATA/zhulifu/bin/Neighborhood-Attention-Transformer-main/detection/cuda/natten.py", line 15, in import nattenav_cuda ModuleNotFoundError: No module named 'nattenav_cuda'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "cuda/gradcheck.py", line 1, in from natten import NATTENAVFunction, NATTENQKRPBFunction File "/media/DATA/zhulifu/bin/Neighborhood-Attention-Transformer-main/detection/cuda/natten.py", line 19, in raise RuntimeError("Could not load NATTEN CUDA extension. " + RuntimeError: Could not load NATTEN CUDA extension. Please make sure your device has CUDA, the CUDA toolkit for PyTorch is installed, and that you've compiled NATTEN correctly.

hi, have you solve the problem?

stevenwalton commented 2 years ago

Hi, can you provide some more information? Have you tried what's in this conversation? Can you confirm that the cache location exists? Have you tried deleting it and recompiling?