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

Bug: 'numpy.random._generator.Generator' object has no attribute 'randint' #2

Open
xinyu-site opened this issue May 15, 2023 · 2 comments

Comments

@xinyu-site
Copy link

xinyu-site commented May 15, 2023

Hello,

I encountered an issue while using your repository. When attempting to run the code, I encountered the following error:

AttributeError: 'numpy.random._generator.Generator' object has no attribute 'randint'
It seems that the error is caused by the missing randint attribute in the numpy.random.Generator object. According to my understanding, the randint method should be available in newer versions of NumPy.

I suspect that this issue may be related to the version of NumPy being used. Therefore, I have a few questions:

What version of NumPy did you use during the development and testing of this repository?
Could you provide a specific NumPy version number that I can try, either to downgrade or upgrade my own NumPy version to potentially resolve this issue?
If this issue is indeed related to the NumPy version, have you considered updating the code to accommodate a wider range of NumPy versions?
Thank you for your help and support! Please let me know if you need any further information.

@XuehaiPan
Copy link
Owner

Hi @xjtueryx, thanks for reporting this! The compact layer for numpy.random.Generator was removed in Gym 0.26.0 (see openai/gym#3022). Could you try:

pip3 install 'gym<0.26.0'

I would range-pin the Gym version or find a more general solution.

@xinyu-site
Copy link
Author

Thank you for your response and explanation regarding the issue I encountered. I followed your guidance and made the necessary changes to my code, and I'm happy to report that the problem has been resolved successfully. Your assistance was invaluable, and I appreciate your help in resolving this issue.

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

2 participants