Hello,
I've encountered an issue with the wav_dataset.py in the audio-data-pytorch/audio_data_pytorch/datasets repository when using torchaudio version 2.1.1. The torchaudio.load function has changed its parameters, affecting lines 60 and 103 of the wav_dataset.py file.
Issue Description
In torchaudio 2.1.1, the torchaudio.load function no longer uses the filepath argument. Instead, it has been replaced with uri. This change causes errors in the following lines of the wav_dataset.py script:
-
Line 60:
Original Code:
waveform, sample_rate = torchaudio.load(filepath=self.wavs[idx], frame_offset=frame_offset, num_frames=crop_size)
Proposed Change:
waveform, sample_rate = torchaudio.load(uri=self.wavs[idx], frame_offset=frame_offset, num_frames=crop_size)
-
Line 103:
Original Code:
waveform, sample_rate = torchaudio.load(filepath=self.wavs[idx])
Proposed Change:
waveform, sample_rate = torchaudio.load(uri=self.wavs[idx])
Suggested Fix:
To maintain compatibility with torchaudio version 2.1.1, I suggest updating these lines to use the uri parameter instead of filepath or removing the filepath keyword and passing the path directly as the first argument . This change should resolve the compatibility issue and ensure the script functions correctly with the latest version of torchaudio.
Thank you for your attention to this matter. I look forward to the update or any alternative solutions you might suggest.
Best regards,
Michele Mancusi
Hello,
I've encountered an issue with the
wav_dataset.pyin theaudio-data-pytorch/audio_data_pytorch/datasetsrepository when using torchaudio version 2.1.1. Thetorchaudio.loadfunction has changed its parameters, affecting lines 60 and 103 of thewav_dataset.pyfile.Issue Description
In torchaudio 2.1.1, the
torchaudio.loadfunction no longer uses thefilepathargument. Instead, it has been replaced withuri. This change causes errors in the following lines of thewav_dataset.pyscript:Line 60:
Original Code:
waveform, sample_rate = torchaudio.load(filepath=self.wavs[idx], frame_offset=frame_offset, num_frames=crop_size)
Proposed Change:
waveform, sample_rate = torchaudio.load(uri=self.wavs[idx], frame_offset=frame_offset, num_frames=crop_size)
Line 103:
Original Code:
waveform, sample_rate = torchaudio.load(filepath=self.wavs[idx])
Proposed Change:
waveform, sample_rate = torchaudio.load(uri=self.wavs[idx])
Suggested Fix:
To maintain compatibility with torchaudio version 2.1.1, I suggest updating these lines to use the uri parameter instead of filepath or removing the
filepathkeyword and passing the path directly as the first argument . This change should resolve the compatibility issue and ensure the script functions correctly with the latest version of torchaudio.Thank you for your attention to this matter. I look forward to the update or any alternative solutions you might suggest.
Best regards,
Michele Mancusi