You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue when training models using opensoundscape: occasionally there will be a file in one of my datasets which causes the following error:
UserWarning: Audio object is shorter than requested duration: 2.8619727891156463 sec instead of 3.0 sec.
When these errors are present, the model doesn't learn at all during training, and progress stalls at chance rates. When I remove the files which generate the short audio objects, the model is able to improve during training.
My current workaround has been to edit the source code in the from_file() function of audio.py like so:
error_msg = ( f"Audio object is shorter than requested duration: " f"{len(samples)/sr} sec instead of {duration} sec. Path: {path}, start_time: {offset} sec, end_time {offset + duration} sec." )
This lets me find the audio clip which is causing the error and remove it from my dataset.
If this is an acceptable workaround, I can make a pull request with this change, but I'd like to check whether there's an existing way to deal with this?
Thanks,
Michael.
The text was updated successfully, but these errors were encountered:
Hi @Mgallimore88 ,
it's surprising that some short audio samples would cause training progress to stall. Are you confident that there aren't any other differences in your training script that could cause the lack of learning? If so, we should examine why this happens on our end.
As for a workaround, I would recommend one of the following:
ignore and suppress the warning by setting Audio.from_file's argument out_of_bounds_mode='ignore'. For instance: m.preprocessor.pipeline.load_audio.set(out_of_bounds_mode='ignore')
raise an error for shorter clips, causing them to be skipped during training (training will continue, just skipping these clips). For instance, m.preprocessor.pipeline.load_audio.set(out_of_bounds_mode='raise')
Hello,
Thanks for the great work you're doing.
I'm encountering an issue when training models using opensoundscape: occasionally there will be a file in one of my datasets which causes the following error:
UserWarning: Audio object is shorter than requested duration: 2.8619727891156463 sec instead of 3.0 sec.
When these errors are present, the model doesn't learn at all during training, and progress stalls at chance rates. When I remove the files which generate the short audio objects, the model is able to improve during training.
My current workaround has been to edit the source code in the from_file() function of audio.py like so:
error_msg = ( f"Audio object is shorter than requested duration: " f"{len(samples)/sr} sec instead of {duration} sec. Path: {path}, start_time: {offset} sec, end_time {offset + duration} sec." )
This lets me find the audio clip which is causing the error and remove it from my dataset.
If this is an acceptable workaround, I can make a pull request with this change, but I'd like to check whether there's an existing way to deal with this?
Thanks,
Michael.
The text was updated successfully, but these errors were encountered: