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

MeltingPot examples do not work #232

Open
jagapiou opened this issue Apr 2, 2024 · 8 comments
Open

MeltingPot examples do not work #232

jagapiou opened this issue Apr 2, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@jagapiou
Copy link
Member

jagapiou commented Apr 2, 2024

The examples need to be updated to ensure they can run.

Currently there are dependency conflicts in the MeltingPot examples/requirements.txt

stable-baselines3 2.2.1 requires gymnasium<0.30,>=0.28.1, but you have gymnasium 0.26.3 which is incompatible.
supersuit 3.9.2 requires gymnasium>=0.28.1, but you have gymnasium 0.26.3 which is incompatible.
pettingzoo 1.24.3 requires gymnasium>=0.28.0, but you have gymnasium 0.26.3 which is incompatible.

No workaround right now, sorry.

@jagapiou jagapiou added the bug Something isn't working label Apr 2, 2024
@jagapiou jagapiou pinned this issue Apr 2, 2024
jagapiou referenced this issue Apr 2, 2024
PiperOrigin-RevId: 617371865
Change-Id: I7992a874b64169ed152126eab64d5b470b317bd6
@rstrivedi
Copy link

rstrivedi commented Apr 2, 2024

Hi John,

We have a fully working versions of baselines in the repository that we used for the contest and that I'm maintaining. This was created in coordination with Edgar, has been well tested and documented and used by several users.

There are two possible resolutions to this bug:
(i) You can remove the examples folder and point to this new repo in Readme for baselines.
(ii) I can push upstream a portion of that repo (working version lightweight files similar to current examples one - and this was our initial plan) to refresh the examples folder.

Please let me know which sounds good to you and I will do that.

Best,
Rakshit

@gogo16888
Copy link

When I test training, like that:
cd examples/rllib
python self_play_train.py
--------------------------->
Display:
2024-04-02 17:56:17.501082: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/mp_home/examples/rllib/self_play_train.py", line 25, in
from . import utils
ImportError: attempted relative import with no known parent package

@gogo16888
Copy link

python -m rllib.self_play_train
------------------------------->
2024-04-03 12:35:40.307164: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/mp_home/examples/rllib/self_play_train.py", line 22, in
from ray.rllib.algorithms import ppo
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/ray/rllib/init.py", line 7, in
from ray.rllib.env.base_env import BaseEnv
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/ray/rllib/env/init.py", line 1, in
from ray.rllib.env.base_env import BaseEnv
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/ray/rllib/env/base_env.py", line 6, in
from ray.rllib.utils.annotations import Deprecated, DeveloperAPI, PublicAPI
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/ray/rllib/utils/init.py", line 6, in
from ray.rllib.utils.filter import Filter
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/ray/rllib/utils/filter.py", line 11, in
from ray.rllib.utils.serialization import _serialize_ndarray, _deserialize_ndarray
File "/home/oeuser/miniconda3/envs/mpnn/lib/python3.11/site-packages/ray/rllib/utils/serialization.py", line 23, in
old_gym_text_class = getattr(old_gym.spaces, "Text", None)
^^^^^^^^^^^^^^
AttributeError: module 'gym' has no attribute 'spaces'

@gogo16888
Copy link

I tried to execute it in the Codespaces container of GitHub, but the examples were also not able to be trained.

@jagapiou
Copy link
Member Author

jagapiou commented Apr 9, 2024

@rstrivedi I'll see what @duenez wants to do, as he's been handling the examples.

@gogo16888 as you've been finding and as this issue documents, the examples don't work. See Rakshit's comment above for a repo with examples that do work.

@gogo16888
Copy link

I check the baselines of Melting-Pot-Contest-2023, it use ray 2.6.1, but the examples use ray 2.5.0, so if I use the baselines, I need update to ray 2.6.1? But the install of Melting-Pot-Contest-2023 is not as Melting-Pot 2.2.2, I am not sure.

@gogo16888
Copy link

If possible, please export the yml file for each version for easy verification of various software packages/tools/library versions during installation.

@rstrivedi
Copy link

I check the baselines of Melting-Pot-Contest-2023, it use ray 2.6.1, but the examples use ray 2.5.0, so if I use the baselines, I need update to ray 2.6.1? But the install of Melting-Pot-Contest-2023 is not as Melting-Pot 2.2.2, I am not sure.

Thank you for your message. We're in the process of updating the examples folder in this repository. Once it is done, everything should match and flow seamlessly.

In the meantime, for your question, it is generally recommended to use ray >= 2.6.1 as there were some known issues with the older versions. So, you can use the combination of:

  • latest version of melting-pot 2.2.2 (from this repository)
  • either ray 2.6.1 or ray 2.20.0 (the latest version)
  • the baselines code from Melting-Pot-Contest-2023 repository

This combination should work without any errors (I've tested this and it works on our end) but let us know if you hit any issues. I'll post here once the examples folder in this repository is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants