AttributeError: ‘numpy.random._generator.Generator‘ object has no attribute ‘randint‘

网友投稿 2470 2022-11-08

AttributeError: ‘numpy.random._generator.Generator‘ object has no attribute ‘randint‘

AttributeError: ‘numpy.random._generator.Generator‘ object has no attribute ‘randint‘

今天在运行github的代码出现了下面的问题:

......envs.py", line 29, in reset noops = self.unwrapped.np_random.randint(1, self.noop_max + 1) #pylint: disable=E1101AttributeError: '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”​​

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:[leetcode] 916. Word Subsets
下一篇:Governments should spend money on railways rather than roads
相关文章

 发表评论

暂时没有评论,来抢沙发吧~