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

In non-docker on Ubuntu 20.04, can't run ppo2: no module named 'baselines.common.models' #350

Open
jecompton opened this issue Mar 20, 2023 · 1 comment

Comments

@jecompton
Copy link

Since the docker builds aren't working, I was able to install GRF on my native Ubuntu 20.04 following the docs on this site. There were two modules that I had to pip install that weren't mentioned: six and baselines.

I pip installed those, and then verified it ran with python -m gfootball.play_game --action_set=full. The field came up fine with all the players running around and such.

However, when I tried to run the ppo2 training with python -m gfootball.examples.run_ppo2 --level=academy_empty_goal_close, I got this error: ModuleNotFoundError: No module named 'baselines.common.models

I looked around on the web, but couldn't figure out which version of baselines might have that. I tried a few, but no luck.

@jecompton
Copy link
Author

I got this to work, no thanks to the maintainers. But hey, I can't complain! I got it to work, and it's far easier for me to fight with python dependency hell than it is to write an amazing football RL framework.

In case this helps someone, Here's what I did.

  1. DO NOT do pip install --upgrade pip setuptools psutil wheel. There is some weird regression that can come up where the setup.py in the gym version dies if you do this.
  2. pip install gfootball
  3. Install the other deps they assumed you had but probably don't in a fresh env: pip install six
  4. Next, you need to install the TF deps for GPU training and such: pip install tensorflow-gpu==1.15.5 dm-sonnet==1.36 psutil. DO NOT do TF 2.x.
  5. If it gripes about cloudpickle, just make sure you are using 1.1.1. that works with me despite it saying it is not compatible. Do pip install -v 'cloudpickle==1.1.1' to make sure you're on the correct version.
  6. Install baselines: pip install git+https://github.com/openai/baselines.git@master
  7. Downgrade your protobufs for the python env with pip -v 'protobuf==3.20.3'.
  8. Verify PPO2 training works: python3 -m gfootball.examples.run_ppo2 --dump_full_episodes=True --render=True

If this doesn't work, try the dockers, but if you're here, you probably tried them first and failed. Good luck!

@jecompton jecompton changed the title In non-docker on Ubuntu 20.04, can't run ppo2: no module named 'baslines.common.models' In non-docker on Ubuntu 20.04, can't run ppo2: no module named 'baselines.common.models' Mar 20, 2023
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

1 participant