今天在运行github的代码https://github.com/DarylRodrigo/rl_lib/tree/master/PPO 出现了下面的问题:

......
envs.py", line 29, in reset
    noops = self.unwrapped.np_random.randint(1, self.noop_max + 1) #pylint: disable=E1101
AttributeError: 'numpy.random._generator.Generator' object has no attribute 'randint'

解决方法

把envs.py的29行换成

noops = self.unwrapped.np_random.integers(1, self.noop_max + 1)

就OK了。

参考文献

[1].[RLlib] AttributeError: ‘numpy.random._generator.Generator’ object has no attribute ‘randint’ in “…/ray/rllib/env/wrappers/atari_wrappers.py”


版权声明:本文为w5688414原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/w5688414/article/details/124655644