audio: undefined symbol when importing torchaudio with pytorch
Hi, When importing torchaudio with pytorch 0.4.1 I get an undefined symbol. It does however work with v0.4.0. audio version: 7314b36
Successfully installed numpy-1.15.0 torch-cpu-0.4.1 torchaudio-0.1
(test_venv) [~]$ python -c "import torchaudio;"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "test_venv/lib/python3.6/site-packages/torchaudio/__init__.py", line 4, in <module>
import _torch_sox
ImportError: test_venv/lib/python3.6/site-packages/_torch_sox.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at5ErrorC1ENS_14SourceLocationESs
Thanks
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 16
- Comments: 15 (2 by maintainers)
using -U option simply solved problem for me
pip install -U torch torchaudio --no-cache-dir
@NumesSanguis PyTorch 1.8.0 and torchaudio 0.8.0 work together. In fact PyTorch 1.8.0 is a strict requirement for torchaudio 0.8.0. For
conda
,pytorch
channel is the official distribution channel, butconda-forge
is not and we do not know how the packages inconda-forge
are maintained. I guess in your case, things got mixed up. Glad to hear that now it’s working.Interested in the solution to this problem as well.
@mthrok Thank you, this was indeed the issue. It was not the versions, but the channel of the conda package.
The release of PyTorch 1.8.0 was released together with the announcement of TorchAudio 0.8.0, so I would assume that these 2 versions would work together:
However, checking
conda list
:That shouldn’t be the CPU version from conda-forge…
I also see an env inconsistency:
To solve it, I reversed the channel priority in my
environment.yml
:pytorch above conda-forge means that pytorch channel is prioritized (if my understanding is correct).