edbeeching / godot_rl_agents

An Open Source package that allows video game creators, AI researchers and hobbyists the opportunity to learn complex behaviors for their Non Player Characters or agents
MIT License
942 stars 69 forks source link

sb3 training error: AssertionError: The algorithm only supports (<class 'gymnasium.spaces.box.Box'>... #119

Closed Ivan-267 closed 1 year ago

Ivan-267 commented 1 year ago

Test on my newest PR (which is a simple .md file change) failed: https://github.com/edbeeching/godot_rl_agents/pull/118/checks, a user also reported the same error on Discord with JumperHard.x86_64, and I was able to confirm the error on Windows with the gdrl command as well by uninstalling stable baselines and installing gdrl again using pip install godot-rl.

The error is: AssertionError: The algorithm only supports (<class 'gymnasium.spaces.box.Box'>, <class 'gymnasium.spaces.discrete.Discrete'>, <class 'gymnasium.spaces.multi_discrete.MultiDiscrete'>, <class 'gymnasium.spaces.multi_binary.MultiBinary'>) as action spaces but Box(-1.0, 1.0, (2,), float32) was provided

In my yesterday's PR the tests passed, so I checked to find differences, and so far I found some differences: New (failing test):

platform linux -- Python 3.7.17, pytest-7.4.0, pluggy-1.2.0
Downloading stable_baselines3-2.0.0-py3-none-any.whl (178 kB)

Previous (passed test):

platform linux -- Python 3.7.17, pytest-7.3.2, pluggy-1.2.0
Downloading stable_baselines3-1.8.0-py3-none-any.whl (174 kB)

I also found this thread that might be related: https://stackoverflow.com/questions/75108957/assertionerror-the-algorithm-only-supports-class-gym-spaces-box-box-as-acti

and the following here: https://github.com/DLR-RM/stable-baselines3/releases

Breaking Changes:

Switched to Gymnasium as primary backend, Gym 0.21 and 0.26 are still supported via the shimmy package 
Ivan-267 commented 1 year ago

Closing the issue as it should be fixed with the PR https://github.com/edbeeching/godot_rl_agents/pull/120