DLR-RM / rl-baselines3-zoo

A training framework for Stable Baselines3 reinforcement learning agents, with hyperparameter optimization and pre-trained agents included.
https://rl-baselines3-zoo.readthedocs.io
MIT License
2.08k stars 516 forks source link

[Question] Do I need to have gym installed in addition to gymnasium in order to run the lunar lander example? #473

Closed jim-rothrock closed 2 weeks ago

jim-rothrock commented 3 weeks ago

❓ Question

I am running Ubuntu 22.04.5 LTS, and have used pip to install the following packages:

When I run the following

python3 enjoy.py --algo ppo --env CartPole-v1

it works as expected. However, when I run

python3 enjoy.py --algo ppo --env LunarLander-v2

I get the following:

Loading latest experiment, id=1 Loading rl-trained-agents/ppo/LunarLander-v2_1/LunarLander-v2.zip Traceback (most recent call last): File "/home/jimr/.local/lib/python3.10/site-packages/rl_zoo3/enjoy.py", line 276, in enjoy() File "/home/jimr/.local/lib/python3.10/site-packages/rl_zoo3/enjoy.py", line 192, in enjoy model = ALGOS[algo].load(model_path, custom_objects=custom_objects, device=args.device, **kwargs) File "/home/jimr/.local/lib/python3.10/site-packages/stable_baselines3/common/base_class.py", line 680, in load data, params, pytorch_variables = load_from_zip_file( File "/home/jimr/.local/lib/python3.10/site-packages/stable_baselines3/common/save_util.py", line 434, in load_from_zip_file data = json_to_data(json_data, custom_objects=custom_objects) File "/home/jimr/.local/lib/python3.10/site-packages/stable_baselines3/common/save_util.py", line 165, in json_to_data deserialized_object = cloudpickle.loads(base64_object) ModuleNotFoundError: No module named 'gym'

Do I need to install gym in addition to gymnasium? I am concerned that installing both will lead to incompatibilities.

Checklist

araffin commented 3 weeks ago

Hello, For running some pretrained agents, you might need gym indeed (0.21), but it should not be needed for using the rest of RL zoo. However, if you retrain a lunar lander model, only Gymnasium is enough.