baselines
baselines copied to clipboard
ImportError: cannot import name 'FlattenObservation'
After I installed it according to the requirements, I got an ImportError: cannot import name 'FlattenObservation' error. I know that it is the version of the gym package or something went wrong elsewhere. Thanks for the help!
File "/home/xxx/baselines/baselines/run.py", line 12, in
pip3 show gym
What version do you see?
I got the same error, you can fix it by installing 0.15.4:
pip3 install gym==0.15.4
I'm getting the same issue and my gym version is 0.15.4... any other recommended fixes?
I am also getting the same issue with 0.15.4. Any help?
So I'm not sure if this is the answer, but upon looking into the gym/gym/wrappers, folder, it looks like there are only files named "flatten_ovservation" and "filter_observation" so I just chose to import the entire wrappers folder with:
from gym import wrappers
in the cmd_util.py file to get beyond this error. Of course now I get a new error though: File "baselines/common/retro_wrappers.py", line 202 def make_retro(*, game, state=None, max_episode_steps=4500, **kwargs): ^ SyntaxError: invalid syntax
https://github.com/openai/baselines/commit/9ee399f5b20cd70ac0a871927a6cf043b478193f Check your gym version first, the package is modified after 0.15.4, you can check the link above, you can reduce your gym version, use the previous package
So what if we have 0.15.4 already? go even earlier?
I was finally able to get it to work, though with gym 0.15.3 not 0.15.4. Also, I had to remove two underscores in the run.py.