Skip to content
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

最新版代码,LibriSpeech复现不成功,run.sh,stage1,RuntimeError: Error loading audio file: failed to open file #2352

Closed
jinleihu opened this issue Feb 20, 2024 · 14 comments

Comments

@jinleihu
Copy link

jinleihu commented Feb 20, 2024

stage 1: Feature Generation
tools/compute_cmvn_stats.py:15: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this func tion is no-op. You can remove the function call.
torchaudio.set_audio_backend("sox_io")
using resample and new sample rate is 16000
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
Traceback (most recent call last):
File "tools/compute_cmvn_stats.py", line 125, in
for i, batch in enumerate(data_loader):
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 630, in next
data = self._next_data()
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data
return self._process_data(data)
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/_utils.py", line 694, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch
return self.collate_fn(data)
File "tools/compute_cmvn_stats.py", line 35, in call
sample_rate = torchaudio.backend.sox_io_backend.info(
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torchaudio/backend/_sox_io_backend.py", line 32, in info
sinfo = torch.ops.torchaudio.sox_io_get_info(filepath, format)
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/_ops.py", line 692, in call
return self._op(*args, **kwargs or {})
RuntimeError: Error loading audio file: failed to open file /home/hujinlei/hjl/LibriSpeech/train-clean-360/1054/143005/1054-143005-0084.fl ac

查看了/home/hujinlei/hjl/LibriSpeech/train-clean-360/1054/143005/1054-143005-0084.flac 文件是存在的

@jinleihu jinleihu changed the title 最新版代码,LibriSpeech复现不成功,run.sh,stage1 最新版代码,LibriSpeech复现不成功,run.sh,stage1,RuntimeError: Error loading audio file: failed to open file Feb 20, 2024
@jinleihu
Copy link
Author

RuntimeError: Error loading audio file: failed to open file /home/hujinlei/hjl/LibriSpeech/train-clean-360/1054/143005/1054-143005-0084.fl ac
发现报错中的路径最后 flac中多了很多空格

@xingchensong
Copy link
Member

重新制作一下数据集试试

@jinleihu
Copy link
Author

重新制作一下数据集试试

您好,我尝试重新跑stage 0,重新跑stage 1,

还是出现类似的错误
RuntimeError: Error loading audio file: failed to open file /home/hujinlei/hjl/LibriSpeech/train-other-500/1595/132753/1595-132753-0011.flac

完整流程如下
/home/hujinlei/hjl/wenet/examples/librispeech/s0# bash run_try.sh

CUDA_VISIBLE_DEVICES is 0,1,2,3,4,5,6,7
stage 1: Feature Generation
tools/compute_cmvn_stats.py:15: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
torchaudio.set_audio_backend("sox_io")
using resample and new sample rate is 16000
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlying implementation directly.
sample_rate = torchaudio.backend.sox_io_backend.info(
Traceback (most recent call last):
File "tools/compute_cmvn_stats.py", line 125, in
for i, batch in enumerate(data_loader):
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 630, in next
data = self._next_data()
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data
return self._process_data(data)
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/_utils.py", line 694, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch
return self.collate_fn(data)
File "tools/compute_cmvn_stats.py", line 35, in call
sample_rate = torchaudio.backend.sox_io_backend.info(
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torchaudio/backend/_sox_io_backend.py", line 32, in info
sinfo = torch.ops.torchaudio.sox_io_get_info(filepath, format)
File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/_ops.py", line 692, in call
return self._op(*args, **kwargs or {})
RuntimeError: Error loading audio file: failed to open file /home/hujinlei/hjl/LibriSpeech/train-other-500/1595/132753/1595-132753-0011.flac

@xingchensong
Copy link
Member

/home/hujinlei/hjl/LibriSpeech/train-other-500/1595/132753/1595-132753-0011.flac 检查这个文件,如果有问题,从stage -1 开始重新跑

@jinleihu
Copy link
Author

/home/hujinlei/hjl/LibriSpeech/train-other-500/1595/132753/1595-132753-0011.flac 检查这个文件,如果有问题,从stage -1 开始重新跑

您好,我按照路径去检查了这个文件,文件是正常的,
11

@jinleihu
Copy link
Author

您好,我参照同学的上个版本的wenet环境,使用torch==1.13.0和torchaudio==0.13.0替代了最新的torch版本之后该问题解决了,可能还是由于版本问题导致的

@jinleihu
Copy link
Author

您好,我参照同学的上个版本的wenet环境,使用torch==1.13.0和torchaudio==0.13.0替代了最新的torch版本之后该问题解决了,可能还是由于版本问题导致的

但替代之后 stage 4 报了新错误 ModuleNotFoundError: No module named 'torch.utils.data.datapipes.iter.sharding'
换回原来的环境就好了...

@Mddct
Copy link
Collaborator

Mddct commented Feb 21, 2024

用readme里边建议的安装一下,这个torch.utils.data.datapipes.iter.sharding, torch 2.0之后才有的

@jinleihu
Copy link
Author

用readme里边建议的安装一下,这个torch.utils.data.datapipes.iter.sharding, torch 2.0之后才有的

是的,用最新版的requirements.txt stage4 是可以跑的,但最新版的环境stage 1 会报错......

用老版的环境stage 1 就不报错了,但stage 4 会卡住 就是应该因为torch版本的问题。目前主要还是没找到为啥最新环境stage 1会报错,我尝试用aishell数据集的话就没问题

@xingchensong
Copy link
Member

librispeech 原始数据是flac格式的,aishell是wav,可能处理flac有点问题

@jinleihu
Copy link
Author

librispeech 原始数据是flac格式的,aishell是wav,可能处理flac有点问题

好的了解,十分感谢您的回复

@lsrami
Copy link
Contributor

lsrami commented Mar 20, 2024

stage 1: Feature Generation tools/compute_cmvn_stats.py:15: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this func tion is no-op. You can remove the function call. torchaudio.set_audio_backend("sox_io") using resample and new sample rate is 16000 tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( tools/compute_cmvn_stats.py:35: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implement ation directly is no longer guaranteed to work. Please use backend keyword with load/save/info function, instead of calling the udnerlyi ng implementation directly. sample_rate = torchaudio.backend.sox_io_backend.info( Traceback (most recent call last): File "tools/compute_cmvn_stats.py", line 125, in for i, batch in enumerate(data_loader): File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 630, in next data = self._next_data() File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data return self._process_data(data) File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/_utils.py", line 694, in reraise raise exception RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch return self.collate_fn(data) File "tools/compute_cmvn_stats.py", line 35, in call sample_rate = torchaudio.backend.sox_io_backend.info( File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torchaudio/backend/_sox_io_backend.py", line 32, in info sinfo = torch.ops.torchaudio.sox_io_get_info(filepath, format) File "/root/anaconda3/envs/wenet/lib/python3.8/site-packages/torch/_ops.py", line 692, in call return self._op(*args, **kwargs or {}) RuntimeError: Error loading audio file: failed to open file /home/hujinlei/hjl/LibriSpeech/train-clean-360/1054/143005/1054-143005-0084.fl ac

查看了/home/hujinlei/hjl/LibriSpeech/train-clean-360/1054/143005/1054-143005-0084.flac 文件是存在的

这是由于在torchaudio更新到2.0以后启用了dispatcher 机制;因此需要更新 compute_cmvn_stats.py ,将torchaudio.backend.sox_io_backend.info改成torchaudio.info

@xingchensong
Copy link
Member

@lsrami 可以提个pr修复吗

@xingchensong xingchensong reopened this Mar 20, 2024
@lsrami
Copy link
Contributor

lsrami commented Mar 20, 2024

@lsrami 可以提个pr修复吗

好的,我可以修复此问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants