ModuleNotFoundError: No module named 'torchaudio.prototype'

See original GitHub issue

🐛 Describe the bug

Having issues getting the Streamer to import. Have tried importing it like this from torchaudio.prototype.io.streamer import Streamer in folders independent of my cloned audio repo. In this case I had torchaudio installed as a pip dependency, however it seemed like it was possibly trying to reference my local audio repo. I was using torch 1.11.0 and torchaudio 0.11.0 Error:

ModuleNotFoundError: No module named 'torchaudio.prototype

Similarly I’ve tried removing the pip torchaudio dependency and trying to run online_asr_tutorial.py from its location in the audio repository and I still get the same issue.

ModuleNotFoundError: No module named 'torchaudio.prototype

I tried adding

import sys sys.path.append(‘…/…/’)

before the torchaudio import in my local copy of online_asr_tutorial.py under the audio repository but I then encountered this.

/home/tand/Projects/audio/examples/tutorials/../../torchaudio/_extension.py:58: UserWarning: torchaudio C++ extension is not available.
  warnings.warn("torchaudio C++ extension is not available.")
1.11.0+cu102
0.12.0a0+4b47412
Traceback (most recent call last):
  File "online_asr_tutorial.py", line 57, in <module>
    from torchaudio.prototype.io import Streamer
  File "/home/tand/Projects/audio/examples/tutorials/../../torchaudio/prototype/io/__init__.py", line 5, in <module>
    torch.ops.torchaudio.ffmpeg_init()
  File "/home/tand/.local/lib/python3.8/site-packages/torch/_ops.py", line 167, in __getattr__
    op = torch._C._jit_get_operation(qualified_op_name)
RuntimeError: No such operator torchaudio::ffmpeg_init

Running online_asr_tutorial.py in google colab also gave the same error (with no file modification):

Reading package lists... Done
1.10.0+cu111
0.10.0+cu111

---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)

[<ipython-input-2-fa57ae3dbf9a>](https://localhost:8080/#) in <module>()
     53 print(torchaudio.__version__)
     54 
---> 55 from torchaudio.prototype.io import Streamer
     56 
     57 ######################################################################

ModuleNotFoundError: No module named 'torchaudio.prototype'

Versions

Collecting environment information… PyTorch version: 1.11.0+cu102 Is debug build: False CUDA used to build PyTorch: 10.2 ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.2 LTS (x86_64) GCC version: (Ubuntu 8.4.0-3ubuntu2) 8.4.0 Clang version: Could not collect CMake version: version 3.22.2 Libc version: glibc-2.31

Python version: 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] (64-bit runtime) Python platform: Linux-5.4.0-100-generic-x86_64-with-glibc2.29 Is CUDA available: True CUDA runtime version: 10.2.89 GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2080 Ti Nvidia driver version: 470.103.01 cuDNN version: /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn.so.7.6.5 HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True

Versions of relevant libraries: [pip3] numpy==1.22.2 [pip3] pytorch-ignite==0.4.8 [pip3] pytorch-lightning==1.5.10 [pip3] torch==1.11.0 [pip3] torchmetrics==0.7.2 [pip3] torchvision==0.11.2 [conda] blas 1.0 mkl
[conda] cudatoolkit 10.2.89 hfd86e86_1
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py38h7f8727e_0
[conda] mkl_fft 1.3.1 py38hd3c417c_0
[conda] mkl_random 1.2.2 py38h51133e4_0
[conda] numpy 1.20.3 py38hf144106_0
[conda] numpy-base 1.20.3 py38h74d4b33_0
[conda] pytorch 1.10.2 py3.8_cuda10.2_cudnn7.6.5_0 pytorch [conda] pytorch-mutex 1.0 cuda pytorch [conda] torchaudio 0.10.2 py38_cu102 pytorch

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mthrokcommented, Apr 3, 2022

I encountered below error [ModuleNotFoundError: No module named 'torchaudio.prototype'](https://github.com/pytorch/audio/issues/2277#)

I figured it out by filling up the empty init.py in torchaudio/prototype

@EdwinYam I see. The prototype modules are not imported automatically. Thus one has to explicitly import it. It’s described here https://pytorch.org/audio/main/prototype.html#torchaudio-prototype .

0reactions
EdwinYamcommented, Apr 3, 2022
Collecting environment information...
PyTorch version: 1.12.0.dev20220401+cu113
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.21.3
Libc version: glibc-2.27

Python version: 3.8.3 | packaged by conda-forge | (default, Jun  1 2020, 17:43:00)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.4.0-107-generic-x86_64-with-glibc2.10
Is CUDA available: True
CUDA runtime version: 11.3.58
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3080
Nvidia driver version: 470.103.01
cuDNN version: Probably one of the following:
/opt/arrayfire/lib64/libcudnn.so.7.6.5
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn.so.8.0.5
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.0.5
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.0.5
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.0.5
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.0.5
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.0.5
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.0.5
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn.so.8.2.1
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.2.1
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.2.1
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.2.1
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.2.1
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.2.1
/usr/local/cuda-11.3/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.2.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.22.3
[pip3] pytorch-lightning==1.5.10
[pip3] pytorch-wpe==0.0.1
[pip3] torch==1.12.0.dev20220401+cu113
[pip3] torch-complex==0.2.1
[pip3] torch-stft==0.1.4
[pip3] torch-tb-profiler==0.3.1
[pip3] torchaudio==0.12.0a0+87f0d19
[pip3] torchmetrics==0.7.2
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.3.1               h2bc3f7f_2  
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py38h7f8727e_0  
[conda] mkl_fft                   1.3.1            py38hd3c417c_0  
[conda] mkl_random                1.2.2            py38h51133e4_0  
[conda] numpy                     1.22.3                   pypi_0    pypi
[conda] pytorch-lightning         1.5.10                   pypi_0    pypi
[conda] pytorch-wpe               0.0.1                    pypi_0    pypi
[conda] torch                     1.12.0.dev20220401+cu113          pypi_0    pypi
[conda] torch-complex             0.2.1                    pypi_0    pypi
[conda] torch-stft                0.1.4                    pypi_0    pypi
[conda] torch-tb-profiler         0.3.1                    pypi_0    pypi
[conda] torchaudio                0.12.0a0+87f0d19          pypi_0    pypi
[conda] torchmetrics              0.7.2                    pypi_0    pypi

I encountered below error [ModuleNotFoundError: No module named 'torchaudio.prototype'](https://github.com/pytorch/audio/issues/2277#)

I figured it out by filling up the empty init.py in torchaudio/prototype

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot import module torchaudio.prototype - Stack Overflow
It says ModuleNotFoundError: No module named 'torchaudio.prototype' How can I import prototype module? pytorch · google-colaboratory · speech-to ...
Read more >
Installing torchaudio on google colab - audio - PyTorch Forums
ModuleNotFoundError : No module named 'torchaudio.prototype'. Try it for yourself using the ctcdecoder - Google Colab.
Read more >
ModuleNotFoundError: No module named 'torchaudio._ext ...
Hi. Even though I've got sox installed, I get a 'module not found' error. This is on Mac, with Anaconda & Python 3.6....
Read more >
Speech Command Recognition with torchaudio
First, let's import the common torch packages such as torchaudio that can be ... For the waveform, we downsample the audio for faster...
Read more >
ModuleNotFoundError: No module named 'torchaudio'
报错:ModuleNotFoundError: No module named 'torchaudio',torch和torchaudio,不兼容,不能直接:pip install torchaudio系统:windows 10conda ...
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