AttributeError: ‘numpy.random.

AttributeError: ‘numpy.random.,第1张

今天在运行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”

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/876069.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存