I am running Ubuntu 22.04.5 LTS, and have used pip to install the following packages:
gymnasium
gymnasium[box2d]
stable-baselines3[extra]
rl_zoo3
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
[X] I have checked that there is no similar issue in the repo
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.
❓ 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