aws / aws/sagemaker-pytorch-training-toolkit

Error importing torchaudio

Open
#226 2 comments 4 reactions 0 assignees View on GitHub
type: bug
Dominant language
Python
Stars
202
Forks
96
PR merge metrics
No merged PRs in 30d

Description

I'm trying to install torchaudio inside the PyTorch container and run into this error. Looking at online forums indicate that multiple torch versions or CUDA issues lead to this error. I tried installing a version that is compatible with the existing torch version (1.6.0) in the container, but it failed with the same error.
```
Traceback (most recent call last):
File "train_model.py", line 32, in
import torchaudio
File "/opt/conda/lib/python3.6/site-packages/torchaudio/__init__.py", line 1, in
from . import extension
File "/opt/conda/lib/python3.6/site-packages/torchaudio/extension/__init__.py", line 5, in
_init_extension()
File "/opt/conda/lib/python3.6/site-packages/torchaudio/extension/extension.py", line 12, in _init_extension
_init_script_module(ext)
File "/opt/conda/lib/python3.6/site-packages/torchaudio/extension/extension.py", line 19, in _init_script_module
torch.classes.load_library(path)
File "/opt/conda/lib/python3.6/site-packages/torch/_classes.py", line 46, in load_library
torch.ops.load_library(path)
File "/opt/conda/lib/python3.6/site-packages/torch/_ops.py", line 105, in load_library
ctypes.CDLL(path)
File "/opt/conda/lib/python3.6/ctypes/__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /opt/conda/lib/python3.6/site-packages/torchaudio/_torchaudio.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure from train_model.py by importing torchaudio in the referenced PyTorch container. Start by checking the installed Python, torch, torchaudio, and CUDA versions against the container setup. Done means the import succeeds without the undefined-symbol error and the compatible dependency combination is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python, pytorch
Domain
devops, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.