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

Empty ValueError raised during augmentation #155

Open
rafaelgreca opened this issue Sep 2, 2022 · 2 comments
Open

Empty ValueError raised during augmentation #155

rafaelgreca opened this issue Sep 2, 2022 · 2 comments

Comments

@rafaelgreca
Copy link

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!

@iver56
Copy link
Collaborator

iver56 commented Sep 19, 2022

@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?

@hbredin
Copy link
Collaborator

hbredin commented Sep 21, 2022

Most likely an off-by-one rounding error due to

original_sample_offset = round(
and
original_num_samples = round(

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.

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

3 participants