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

JumperHarder example not working #132

Closed derkork closed 1 year ago

derkork commented 1 year ago

I installed godot-rl and tried to run the JumperHarder example. I started gdrl at the console and ran the example using the play button in the Godot editor. The gdrl process exits with this exception:

Successfully installed godot-rl-0.4.7

(godot_rl) D:\devel\godot_rl>gdrl
No game binary has been provided, please press PLAY in the Godot editor
waiting for remote GODOT connection on port 11008
connection established
action space {'jump': {'action_type': 'discrete', 'size': 2}, 'move': {'action_type': 'continuous', 'size': 1}, 'turn': {'action_type': 'continuous', 'size': 1}}
observation space {'obs': {'size': [152], 'space': 'box'}}
Using cpu device
Traceback (most recent call last):
  File "C:\Users\kork\.conda\envs\godot_rl\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\kork\.conda\envs\godot_rl\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\kork\.conda\envs\godot_rl\Scripts\gdrl.exe\__main__.py", line 7, in <module>
  File "C:\Users\kork\.conda\envs\godot_rl\lib\site-packages\godot_rl\main.py", line 120, in main
    training_function(args, extras)
  File "C:\Users\kork\.conda\envs\godot_rl\lib\site-packages\godot_rl\wrappers\stable_baselines_wrapper.py", line 76, in stable_baselines_training
    model = PPO(
  File "C:\Users\kork\.conda\envs\godot_rl\lib\site-packages\stable_baselines3\ppo\ppo.py", line 104, in __init__
    super().__init__(
  File "C:\Users\kork\.conda\envs\godot_rl\lib\site-packages\stable_baselines3\common\on_policy_algorithm.py", line 81, in __init__
    super().__init__(
  File "C:\Users\kork\.conda\envs\godot_rl\lib\site-packages\stable_baselines3\common\base_class.py", line 180, in __init__
    assert isinstance(self.action_space, supported_action_spaces), (
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, (3,), float32) was provided
exit was not clean, using atexit to close env
close message sent

(godot_rl) D:\devel\godot_rl>
derkork commented 1 year ago

Same for the BallChase example. Looks to me like some library problem, but I have not enough experience with Python to fix it myself.

derkork commented 1 year ago

I was able to fix it by creating a new Conda environment with Python 3.10 and running pip install https://github.com/edbeeching/godot_rl_agents/archive/refs/heads/main.zip (the master version).

edbeeching commented 1 year ago

hi @derkork this should be fixed with the latest version of godot-rl, please try and fresh installation with pip install godot-rl and let me know if you have any further issues.

edbeeching commented 1 year ago

@derkork , did it work? Ok to close the issue?

derkork commented 1 year ago

Yes, thank you very much!