tensorforce icon indicating copy to clipboard operation
tensorforce copied to clipboard

quickstart: openai_gym AttributeError: module 'gym.wrappers' has no attribute 'Monitor'

Open hpcpony opened this issue 2 years ago • 2 comments

tensorforce: 0.6.5

[user 0.6.5]$ python ../quick.py 
WARNING:root:Infinite min_value bound for state.
Traceback (most recent call last):
  File "/home/user/0.6.5/../quick.py", line 24, in <module>
    states = environment.reset()
  File "/opt/RL/Python_3.10.4_tensorforce/lib/python3.10/site-packages/tensorforce/environments/environment.py", line 529, in reset
    states = self._environment.reset()
  File "/opt/RL/Python_3.10.4_tensorforce/lib/python3.10/site-packages/tensorforce/environments/openai_gym.py", line 227, in reset
    if isinstance(self.environment, gym.wrappers.Monitor):
AttributeError: module 'gym.wrappers' has no attribute 'Monitor'

From what I've been able to determine Monitor was removed from gym 0.23.0:

https://github.com/openai/gym/releases/tag/0.23.0

When I pip3 install ./tensorforce it seems to have retrieved gym 0.23.1

hpcpony avatar Apr 06 '22 16:04 hpcpony

Hi @hpcpony, thanks for reporting, that seems to be a recent Gym change and the framework needs to be updated correspondingly. Will do so.

AlexKuhnle avatar Apr 07 '22 10:04 AlexKuhnle

Will do so.

Any way I could help? I would like to try tensorforce, but my environment is fully developed in the 0.25.2 gym version.

cserpell avatar Aug 30 '22 21:08 cserpell