google-deepmind / meltingpot

A suite of test scenarios for multi-agent reinforcement learning.
Apache License 2.0
617 stars 121 forks source link

MeltingPot examples do not work #232

Open jagapiou opened 7 months ago

jagapiou commented 7 months ago

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.

rstrivedi commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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

jagapiou commented 7 months ago

@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 commented 6 months ago

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 commented 6 months ago

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

rstrivedi commented 6 months ago

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:

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.