DQN_DDQN_Dueling_and_DDPG_Tensorflow icon indicating copy to clipboard operation
DQN_DDQN_Dueling_and_DDPG_Tensorflow copied to clipboard

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

Open tygrer opened this issue 6 years ago • 3 comments

[2018-04-23 15:16:46,849] Making new env: Seaquest-v0 Traceback (most recent call last): File "gym_dqn_atari.py", line 58, in env = AtariEnvWrapper(ENV_NAME) File "/home/tanggy/Downloads/DQN_DDQN_Dueling_and_DDPG_Tensorflow-master/modules/env_utils.py", line 32, in init self.monitor = self.env.monitor AttributeError: 'TimeLimit' object has no attribute 'monitor'

gym version is 0.9.2

tygrer avatar Apr 23 '18 07:04 tygrer

Unfortunately this code is a bit old and deprecated. You can solve the problem by removing all references to 'monitor' from the code.

spiglerg avatar Apr 23 '18 10:04 spiglerg

@spiglerg I through the following steps to solve the issue: change self.monitor = self.env.monitor to: self.monitor = Monitor(self.env,"./test/",force=True) ,and also add title including module: from gym.wrappers.monitoring import Monitor

In gym_dqn_atari.py file, change env.monitor.start(outdir+'/'+ENV_NAME,force = True, video_callable=multiples_video_schedule) to: Monitor(env, outdir+'/'+ENV_NAME,force = True)

The program can run.

tygrer avatar Apr 24 '18 06:04 tygrer

@spiglerg How can the program restore the Q-learning weight by continuing train the program, whether the program can do this?

tygrer avatar Apr 24 '18 07:04 tygrer