rll / rllab

rllab is a framework for developing and evaluating reinforcement learning algorithms, fully compatible with OpenAI Gym.
Other
2.89k stars 803 forks source link

Cannot import name 'monitor' for trpo_gym #67

Open ashwinreddy opened 7 years ago

ashwinreddy commented 7 years ago

I successfully installed rllab, and the trpo_cartpole.py example worked fine, but I'm getting an error with trpo_gym.py:

Traceback (most recent call last):
  File "trpo_gym.py", line 6, in <module>
    from rllab.envs.gym_env import GymEnv
  File "/home/ashwin/Research/rllab/rllab/envs/gym_env.py", line 4, in <module>
    from gym.monitoring import monitor
ImportError: cannot import name 'monitor'

I was looking at the latest Gym source code and gym.monitoring is definitely there but I can't find any monitor method or class.

dementrock commented 7 years ago

Sorry for the late reply! There has been some updates made to the gym repo. Should be fixed in 142b68ddb907f4b3c7e50b4f2299127296d7ce74.

AjayTalati commented 7 years ago

Oh dear :( , seems like it might be broken again?

Traceback (most recent call last):
  File "./examples/trpo_gym.py", line 3, in <module>
    from rllab.envs.gym_env import GymEnv
  File "/home/ajay/PythonProjects/rllab/rllab/envs/gym_env.py", line 5, in <module>
    from gym.monitoring import monitor_manager
ImportError: cannot import name 'monitor_manager' 
dementrock commented 7 years ago

Fixed!

AjayTalati commented 7 years ago

Fan Q :)

By the way, have you seen this

LEARNING TO REINFORCEMENT LEARN

Be really cool if you released your RL^2 code?

dementrock commented 7 years ago

Hi @AjayTalati, yes we are working on the code release :) It has been delayed mostly because the first-order modifications to TRPO is waiting to be released separately. The learning to reinforcement learn paper has very similar ideas (except the learning algorithm used), so if you'd like to work on any follow-up ideas, your linked repo could be a good starting point.

sergiovalmac commented 7 years ago

Hi, I am getting this same error with trpo_gym.py: Traceback (most recent call last): File "/home/love/rl/rllab/examples/trpo_gym.py", line 6, in <module> from rllab.envs.gym_env import GymEnv File "/home/love/rl/rllab/rllab/envs/gym_env.py", line 4, in <module> from gym.monitoring import monitor ImportError: cannot import name 'monitor' Any quick fix? Thanks!

dementrock commented 7 years ago

@serteckian Make sure you are using the latest rllab code?

chelseas commented 6 years ago

This fixed things for me: from gym.wrappers.monitor import Monitor