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

ValueError: low >= high #10

Closed
enhuiz opened this issue Oct 29, 2020 · 2 comments
Closed

ValueError: low >= high #10

enhuiz opened this issue Oct 29, 2020 · 2 comments
Labels

Comments

@enhuiz
Copy link

enhuiz commented Oct 29, 2020

WaveGrad/data.py

Lines 47 to 49 in 6be2f4c

if audio.shape[-1] >= self.segment_length:
max_audio_start = audio.shape[-1] - self.segment_length
audio_start = np.random.randint(0, max_audio_start)

Since np.random.randint has the right exclusive boundary, np.random.randint(0, 0) raises an error. Consider to switch to random.randint or change to audio.shape[-1] > self.segment_length?

@ivanvovk
Copy link
Owner

@enhuiz Yeah, you are right, it is a bug. Thank you for your feedback. I will push an update with second approach.

@ivanvovk
Copy link
Owner

ivanvovk commented Nov 1, 2020

Closing issue since the problem is solved.

@ivanvovk ivanvovk closed this as completed Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants