Open rafaelgreca opened 2 years ago
@hbredin Can you imagine why this would happen? The code does raise ValueError()
without giving a specific error message. How can we improve the code?
Most likely an off-by-one rounding error due to https://github.com/asteroid-team/torch-audiomentations/blob/1590056ba3bbb06a75e24fb4bcec0fd10569a083/torch_audiomentations/utils/io.py#L232 and https://github.com/asteroid-team/torch-audiomentations/blob/1590056ba3bbb06a75e24fb4bcec0fd10569a083/torch_audiomentations/utils/io.py#L238
I believe using math.floor
instead of round
should fix the issue and we could safely remove the check that raises the ValueError
.
@rafaelgreca could you by any chance find a way for us to reproduce the error?
You could just replace raise ValueError()
by something like
raise ValueError(f"{audio_path=} {sample_offset=} {num_samples=}")
to find the faulty input argument combination.
Hello!
I am doing augmentation on a bunch of audio files using batches, but somewhere in between I am getting an empty ValueError error. I know this error is coming from the io.py file located inside the utils folder (more precisely here), but I don't know what is causing it and how to fix it.
Any ideas on how to work around this issue?
Thanks in advance!