AttributeError: 'TimeLimit' object has no attribute 'monitor'

Posted lmengzi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AttributeError: 'TimeLimit' object has no attribute 'monitor'相关的知识,希望对你有一定的参考价值。

原报错代码部分:
env.monitor.start(monitor_path,
resume=True,
video_callable=lambda count: count % record_video_every == 0)

reason:
env.monitor is deprecated. Wrap your env with gym.wrappers.Monitor to record data.

所以改为 env = Monitor()
注意:1.加from gym.wrappers import monitor
2.Monitor()内部参数要改为Monitor(env, directory=monitor_path,其他直接写)










以上是关于AttributeError: 'TimeLimit' object has no attribute 'monitor'的主要内容,如果未能解决你的问题,请参考以下文章

ddt运行报错AttributeError: type object 'TestLogin' has no attribute 'test_login'

startTime = time.clock()AttributeError: module ‘time‘ has no attribute ‘clock

startTime = time.clock()AttributeError: module ‘time‘ has no attribute ‘clock

t0 = time.clock() AttributeError: module ‘time‘ has no attribute ‘clock‘

Django,gunicorn,nginx 抛出 504 Gateway Time-out: AttributeError: module 'static' has no attribute 'Cli

AttributeError:“numpy.ndarray”对象没有属性“时钟”