From 1d758c3bc8022709ad129c31a8108132542897cb Mon Sep 17 00:00:00 2001 From: James Betker Date: Mon, 23 May 2022 08:50:27 -0600 Subject: [PATCH] try and make repeated failures recover better --- codes/data/audio/unsupervised_audio_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/data/audio/unsupervised_audio_dataset.py b/codes/data/audio/unsupervised_audio_dataset.py index 284e402e..6fd9fee9 100644 --- a/codes/data/audio/unsupervised_audio_dataset.py +++ b/codes/data/audio/unsupervised_audio_dataset.py @@ -139,7 +139,7 @@ class UnsupervisedAudioDataset(torch.utils.data.Dataset): except: if self.debug_loading_failures: print(f"Error loading audio for file {self.audiopaths[index]} {sys.exc_info()}") - return self[index+1] + return self[random.randint(0,len(self))] # When generating resampled clips, skew is a bias that tries to spread them out from each other, reducing their # influence on one another.