Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import name 'monitor' for trpo_gym #67

Open
ashwinreddy opened this issue Dec 25, 2016 · 8 comments
Open

Cannot import name 'monitor' for trpo_gym #67

ashwinreddy opened this issue Dec 25, 2016 · 8 comments

Comments

@ashwinreddy
Copy link

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
Copy link
Member

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

@ghost
Copy link

ghost commented Feb 5, 2017

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
Copy link
Member

Fixed!

@ghost
Copy link

ghost commented Feb 6, 2017

Fan Q :)

By the way, have you seen this

LEARNING TO REINFORCEMENT LEARN

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

@dementrock
Copy link
Member

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
Copy link

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
Copy link
Member

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

@chelseas
Copy link

chelseas commented Jul 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants