-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined symbol when importing torchaudio with pytorch #62
Comments
I also encounter same problem. |
Same problem. When I use virtual environment in conda, it occurs while it doesn't occur in the base environment. |
How to install the package into existing virtual environment with Anaconda3? |
To be Use the 'base' environment may cause some unkown errors,how to fix this bug? |
With torch 1.0.0, I monkey patched this issue. It is caused by an issue in torch where is does not detect correctly the ABI of the wheel and forces to add Make sure Pytorch issue: pytorch/pytorch#16972 |
@ccoulombe How do I make sure that torchaudio is compiled with that specific flag? |
Interested in the solution to this problem as well. |
Really intersted in this solution as well: I have the same problem with Virtual AND Base environments. I use
Would be very much appreciated if we re-opened this issue [EDIT : solved this issue by downgrading to |
This issue was fixed in pytorch ~1.0.0 but I can re-trace the steps and provide more details when building from source. But maybe the wheels available on PyPI are built differently. See : #62 (comment) |
This issue occurred to me with
Full Traceback (CLICK ME)
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-1-b60aa7932a25> in <module>
6 from torchvision import transforms
7 # import torchaudio
----> 8 from torchaudio import transforms as atransforms
9 import pytorch_lightning as pl
10 from pytorch_lightning import Trainer
~/anaconda3/envs/some_env/lib/python3.8/site-packages/torchaudio/__init__.py in <module>
----> 1 from . import extension # noqa: F401
2 from torchaudio._internal import module_utils as _mod_utils # noqa: F401
3 from torchaudio import (
4 compliance,
5 datasets,
~/anaconda3/envs/some_env/lib/python3.8/site-packages/torchaudio/extension/__init__.py in <module>
3 )
4
----> 5 _init_extension()
6
7 del _init_extension
~/anaconda3/envs/some_env/lib/python3.8/site-packages/torchaudio/extension/extension.py in _init_extension()
9 ext = 'torchaudio._torchaudio'
10 if _mod_utils.is_module_available(ext):
---> 11 _init_script_module(ext)
12 else:
13 warnings.warn('torchaudio C++ extension is not available.')
~/anaconda3/envs/some_env/lib/python3.8/site-packages/torchaudio/extension/extension.py in _init_script_module(module)
16 def _init_script_module(module):
17 path = importlib.util.find_spec(module).origin
---> 18 torch.classes.load_library(path)
19 torch.ops.load_library(path)
~/anaconda3/envs/some_env/lib/python3.8/site-packages/torch/_classes.py in load_library(self, path)
44 path (str): A path to a shared library to load.
45 """
---> 46 torch.ops.load_library(path)
47
48 # The classes "namespace"
~/anaconda3/envs/some_env/lib/python3.8/site-packages/torch/_ops.py in load_library(self, path)
102 # static (global) initialization code in order to register custom
103 # operators with the JIT.
--> 104 ctypes.CDLL(path)
105 self.loaded_libraries.add(path)
106
~/anaconda3/envs/some_env/lib/python3.8/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
379
380 if handle is None:
--> 381 self._handle = _dlopen(self._name, mode)
382 else:
383 self._handle = handle
OSError: /home/user/anaconda3/envs/some_env/lib/python3.8/site-packages/torchaudio/_torchaudio.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs |
@NumesSanguis The error means that your PyTorch C++ binary does not contain the function that torchaudio needs. It is likely version mismatch between torchaudio and pytorch. |
@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
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 channels:
- defaults
- pytorch
- conda-forge pytorch above conda-forge means that pytorch channel is prioritized (if my understanding is correct). |
@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 |
I've same problem and couldn't find solution how to. I just changed kernel virenv from python 3.7 to python 3.6 then magically error's gone. |
using -U option simply solved problem for me |
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
Thanks
The text was updated successfully, but these errors were encountered: