Update for latest gym

This commit is contained in:
Shangtong Zhang
2018-02-09 22:02:58 -07:00
parent e7f036bc6b
commit d4aa8d4a22
6 changed files with 36 additions and 37 deletions
-7
View File
@@ -7,7 +7,6 @@
import numpy as np
import pickle
import os
import gym.monitoring
def run_episodes(agent):
config = agent.config
@@ -31,12 +30,6 @@ def run_episodes(agent):
agent_type, config.tag, agent.task.name), 'wb') as f:
pickle.dump([steps, rewards], f)
if config.render_episode_freq and ep % config.render_episode_freq == 0:
video_recoder = gym.monitoring.VideoRecorder(
env=agent.task.env, base_path='./data/video/%s-%s-%s-%d' % (agent_type, config.tag, agent.task.name, ep))
agent.episode(True, video_recoder)
video_recoder.close()
if config.episode_limit and ep > config.episode_limit:
break