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.

undefined symbol error with PyTorch 1.12 and Torchvision 0.13

See original GitHub issue

Thanks for reporting the unexpected results and we appreciate it a lot.

Describe the Issue

With CUDA 11.3, PyTorch 1.12 and Torchvision 0.13, using MMCV 1.5.3, I get the error:

ImportError: /opt/conda/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK3c1010TensorImpl36is_contiguous_nondefault_policy_implENS_12MemoryFormatE

Reproduction

  1. What command, code, or script did you run?

MMDetection v2.25.0 train.py

  1. Did you make any modifications on the code? Did you understand what you have modified?

No

Environment

  1. Please run python -c "from mmcv.utils import collect_env; print(collect_env())" to collect necessary environment information and paste it here.

Can’t run this - same error as above

  1. You may add addition that may be helpful for locating the problem, such as
    • How you installed PyTorch [e.g., pip, conda, source]: pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
    • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)
    • PATH: /opt/amazon/openmpi/bin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    • LD_LIBRARY_PATH: /opt/conda/lib/python3.8/site-packages/smdistributed/dataparallel/lib:/opt/amazon/openmpi/lib/:/opt/amazon/efa/lib/:/opt/conda/lib:/usr/local/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64

Error traceback

root@1a67d2e00d91:/# python -c “from mmcv.utils import collect_env; print(collect_env())” Traceback (most recent call last): File “<string>”, line 1, in <module> File “/opt/conda/lib/python3.8/site-packages/mmcv/utils/env.py”, line 112, in collect_env from mmcv.ops import get_compiler_version, get_compiling_cuda_version File “/opt/conda/lib/python3.8/site-packages/mmcv/ops/init.py”, line 2, in <module> from .active_rotated_filter import active_rotated_filter File “/opt/conda/lib/python3.8/site-packages/mmcv/ops/active_rotated_filter.py”, line 10, in <module> ext_module = ext_loader.load_ext( File “/opt/conda/lib/python3.8/site-packages/mmcv/utils/ext_loader.py”, line 13, in load_ext ext = importlib.import_module(‘mmcv.’ + name) File “/opt/conda/lib/python3.8/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: /opt/conda/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK3c1010TensorImpl36is_contiguous_nondefault_policy_implENS_12MemoryFormatE

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
zhouzaidacommented, Jul 12, 2022

Hi @austinmw , we have just uploaded the pre-built packages for torch1.12. Enjoy the latest PyTorch and MMCV with the following commands.

pip install -U openmim
mim install -U mmcv-full
2reactions
zhouzaidacommented, Jul 7, 2022

Hi @austinmw , we have not provided the pre-built packages for torch1.12 so you need to install mmcv-full from source (https://mmcv.readthedocs.io/en/latest/get_started/build.html#build-on-linux-or-macos). Another way is to install torch1.11 we had provided packages for it. BTW, we will provide pre-built packages for torch1.12 in the next few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined symbol · Issue #261 · rusty1s/pytorch_sparse
I think the issue is that you are using PyTorch 1.12 while you are installing the wheels for PyTorch 1.11. Can you confirm?...
Read more >
Failed to load image Python extension: Could not find ...
I'm seeing the same error on Windows 10 with Python 3.7, PyTorch 1.12.1 and torchvision 0.13.1. However, it looks like the warning message ......
Read more >
Undefined symbol pytorch 1.7.0 and above
Usually you would get this error message if you are trying to import custom extensions before importing PyTorch, which doesn't seem to be...
Read more >
ImportError after upgrading pytorch and torchvision inside ...
Hi! I recently have to upgrade the version of pytorch from 1.1 to 1.3.1. However, I'm getting this error :frowning: ImportError: ...
Read more >
Pytorch 1.0 installation via conda cpu version undefined ...
Hi, I get undefined symbol as follows conda create --name pytorch10 conda activate pytorch10 conda install pytorch-cpu torchvision-cpu -c ...
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