araffin / rl-baselines-zoo

A collection of 100+ pre-trained RL agents using Stable Baselines, training and hyperparameter optimization included.
https://stable-baselines.readthedocs.io/
MIT License
1.12k stars 208 forks source link

ImportError: cannot import name 'FlattenDictWrapper' #51

Closed renan-cunha closed 4 years ago

renan-cunha commented 4 years ago

I tried run the trained agents locally and from Docker, the same bug about FlattenDictWrapper appear

Code example

Traceback (most recent call last):
  File "train.py", line 25, in <module>
    from stable_baselines.common.cmd_util import make_atari_env
  File "/root/venv/lib/python3.5/site-packages/stable_baselines/common/cmd_util.py", line 8, in <module>
    from gym.wrappers import FlattenDictWrapper
ImportError: cannot import name 'FlattenDictWrapper'

System Info Describe the characteristic of your environment: Stable_baselines was installed from PIP and Docker Use on CPU The local python version is 3.7 The local Tensorflow version is 1.14

araffin commented 4 years ago

Hello, This comes from your gym version, they recently break their code again... (cf https://github.com/openai/baselines/pull/1034/files) We would appreciate if you could submit a PR that solves this issue.

EDIT: the PR should be submitted to stable-baselines, not the zoo.

araffin commented 4 years ago

Fixed in https://github.com/hill-a/stable-baselines/commit/d8cc795b75939452f9ac65f24b941d7e83d63289