openai / gym-http-api

API to access OpenAI Gym from other languages via HTTP
MIT License
293 stars 142 forks source link

fix: monitor wrapper #30

Closed kkweon closed 7 years ago

kkweon commented 7 years ago

If I try to record results, the following error is raised

raise error.Error("env.monitor has been deprecated as of 12/23/2016. Remove your call to env.monitor.start(directory) and instead wrap your env with env = gym.wrappers.Monitor(env, directory) to record data.")

The correct way to use monitors:

Open Monitor

from gym import wrappers
env = gym.make('CartPole-v0')
env = wrappers.Monitor(env, LOG_DIR)

Close Monitor

env.close()