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.

import torchaudio error

See original GitHub issue

Thanks for introducing torchaudio. However, I’m getting an error on Linux, Python 3.5, CUDA 10. Works OK on Linux, Python 3.5, and CUDA 9.2

Here is the error

Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import torchaudio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torchaudio/__init__.py", line 8, in <module>
    from torchaudio import transforms, datasets, kaldi_io, sox_effects, compliance, _docs
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torchaudio/transforms.py", line 6, in <module>
    from . import functional as F
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torchaudio/functional.py", line 175, in <module>
    @torch.jit.script
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torch/jit/__init__.py", line 1181, in script
    return _compile_function(fn=obj, qualified_name=qualified_name, _frames_up=_frames_up + 1, _rcb=_rcb)
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torch/jit/__init__.py", line 1077, in _compile_function
    script_fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(fn))
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torch/jit/annotations.py", line 58, in get_signature
    return parse_type_line(type_line)
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torch/jit/annotations.py", line 110, in parse_type_line
    arg_types = [ann_to_type(ann) for ann in arg_ann]
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torch/jit/annotations.py", line 110, in <listcomp>
    arg_types = [ann_to_type(ann) for ann in arg_ann]
  File "/home/abisw/pytorch-py35/lib/python3.5/site-packages/torch/jit/annotations.py", line 227, in ann_to_type
    raise ValueError("Unknown type annotation: '{}'".format(ann))
ValueError: Unknown type annotation: 'typing.Union[int, NoneType]'
>>>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
arijit17commented, Aug 19, 2019

Hi @jamarshon I tried it. Very interesting that everything works in the conda environment as you suggested.

I installed latest anaconda.

Then did: $ conda create --name env3.5 python=3.5 $ conda activate env3.5

Then pip3 install torch torchvision pip3 install torchaudio

And everything works with CUDA10, Python 3.5! So, closing the issue … but maybe there is still something fishy for you to investigate, i.e. why it’s not working in a non-conda environment.

0reactions
LearnedVectorcommented, Jan 14, 2020

Same issue. Can we keep this open? Seems to not work in a non conda environment

Read more comments on GitHub >

github_iconTop Results From Across the Web

Torchaudio import error - audio - PyTorch Forums
The error message indicates a mismatch between the PyTorch version expected by torchaudio and the one installed. Generally, compiling the auxiliary libraries ( ......
Read more >
unable to load torchaudio even after installing - Stack Overflow
I'm trying to use torchaudio but I'm unable to import it. I have installed it and it is also visible through the pip...
Read more >
Problems with torchaudio install in ubuntu 20 and python38
import torchaudio Traceback (most recent call last): File "<stdin>", line 1, ... torchaudio and import it, it gives me the following error:…
Read more >
torchaudio - PyPI
torchaudio 0.13.1. pip install torchaudio. Copy PIP instructions. Latest version. Released: Dec 15, 2022. An audio package for PyTorch ...
Read more >
Error while importing torchaudio in a kaggle notebook - Reddit
I'm getting this error: `AttributeError: module 'torchaudio._internal.module_utils' has no attribute 'requires_sox'` while importing ...
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