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

Cap the 'trng' random seeds to 2**31 avoiding numpy error #1379

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

pzelasko
Copy link
Collaborator

@pzelasko pzelasko commented Aug 2, 2024

The previous 2**32 value can cause the following issue with some numpy versions:

  File "/usr/local/lib/python3.10/dist-packages/lhotse/utils.py", line 138, in fix_random_seed
    np.random.seed(random_seed)
  File "mtrand.pyx", line 4789, in numpy.random.mtrand.seed
  File "mtrand.pyx", line 250, in numpy.random.mtrand.RandomState.seed
  File "_mt19937.pyx", line 166, in numpy.random._mt19937.MT19937._legacy_seeding
  File "_mt19937.pyx", line 180, in numpy.random._mt19937.MT19937._legacy_seeding
ValueError: Seed must be between 0 and 2**32 - 1

@pzelasko pzelasko added this to the 1.27.0 milestone Aug 2, 2024
@pzelasko pzelasko merged commit bcd1e22 into master Aug 2, 2024
9 checks passed
@pzelasko pzelasko deleted the cap-resolve-seed-returnval branch August 2, 2024 22:18
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

Successfully merging this pull request may close these issues.

1 participant