# Error in torchaudio.load when loading dataset

**URL:** <https://discuss.pytorch.org/t/error-in-torchaudio-load-when-loading-dataset/159156>\
**Category:** Uncategorized\
**Created:** [August 14, 2022, 4:42pm UTC](https://discuss.pytorch.org/t/error-in-torchaudio-load-when-loading-dataset/159156 "2022-08-14T16:42:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![skerlet\_flandorle](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/skerlet_flandorle/32/25798_2.png) [@skerlet\_flandorle](https://discuss.pytorch.org/u/skerlet_flandorle)\
**Post date:** [August 14, 2022, 4:42pm UTC](https://discuss.pytorch.org/t/error-in-torchaudio-load-when-loading-dataset/159156/1 "2022-08-14T16:42:59Z")

</div>

hello  
I tried to learn using the LibriSpeech dataset but failed

I was able to get into DataLoader, but I got an error at for i, (\_\_\_) in enumerate(train\_loader):  
Apparently it’s at torchaudio.load

```auto
Traceback (most recent call last):
  File "test.py", line 187, in <module>
    main()
  File "test.py", line 181, in main
    chapter_id,utterance_id,) in enumerate(train_loader):
  File "C:\Users\PC_User\Anaconda3\envs\newflan22a08m14d\lib\site-packages\torch\utils\data\dataloader.py", line 681, in __next__
    data = self._next_data()
  File "C:\Users\PC_User\Anaconda3\envs\newflan22a08m14d\lib\site-packages\torch\utils\data\dataloader.py", line 721, in _next_data
    data = self._dataset_fetcher.fetch(index) # may raise StopIteration
  File "C:\Users\PC_User\Anaconda3\envs\newflan22a08m14d\lib\site-packages\torch\utils\data\_utils\fetch.py", line 49, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\PC_User\Anaconda3\envs\newflan22a08m14d\lib\site-packages\torch\utils\data\_utils\fetch.py", line 49, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\PC_User\Desktop\ml-agents-0.15.0\mem_apri_tests\AI\voice_net2\detaset.py", line 133, in __getitem__
    return load_librispeech_item(fileid, self._path, self._ext_audio, self._ext_txt)
  File "C:\Users\PC_User\Desktop\ml-agents-0.15.0\mem_apri_tests\AI\voice_net2\detaset.py", line 55, in load_librispeech_item
    waveform, sample_rate = torchaudio.load(file_audio)
  File "C:\Users\PC_User\Anaconda3\envs\newflan22a08m14d\lib\site-packages\torchaudio\backend\no_backend.py", line 16, in load
    raise RuntimeError("No audio I/O backend is available.")
RuntimeError: No audio I/O backend is available.

```

I don’t know if it’s related, but I also get a warning like this

```auto
C:\Users\PC_User\Anaconda3\envs\newflan22a08m14d\lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load image Python extension:
  warn(f"Failed to load image Python extension: {e}")
C:\Users\PC_User\Anaconda3\envs\newflan22a08m14d\lib\site-packages\torchaudio\backend\utils.py:62: UserWarning: No audio backend is available.
  warnings.warn("No audio backend is available.")

```

environment  
pytorch 1.12.1 py3.7\_cuda11.3\_cudnn8\_0 pytorch  
python 3.7  
os win10  
anaconda

Here is the reference  
[https://pytorch.org/audio/stable/\_modules/torchaudio/datasets/librispeech.html](https://pytorch.org/audio/stable/_modules/torchaudio/datasets/librispeech.html)

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [August 14, 2022, 7:05pm UTC](https://discuss.pytorch.org/t/error-in-torchaudio-load-when-loading-dataset/159156/2 "2022-08-14T19:05:08Z")

</div>

Your `torchaudio` build doesn’t find any supported backend.  
On Windows `soundfile` would be the default as exmplained [here](https://pytorch.org/audio/stable/backend.html), but you might need to follow these instructions first:

> `"soundfile"` backend requires `SoundFile`. Please refer to [the SoundFile documentation](https://pysoundfile.readthedocs.io/en/latest/) for the installation.
