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

pip install error on: pip install godot-rl[sf] #45

Closed visuallization closed 1 year ago

visuallization commented 1 year ago

Hi there,

First of all thanks for this great rl framework. Really cool work you gus did there.

I am currently experience an issue when trying to run the command pip install godot-rl[sf]. I receive this error:

Collecting faster-fifo<2.0,>=1.4.2
  Using cached faster-fifo-1.4.2.tar.gz (84 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      Compiling faster_fifo.pyx because it depends on C:\Users\flore\AppData\Local\Temp\pip-build-env-th443ciw\overlay\Lib\site-packages\Cython\Includes\libcpp\__init__.pxd.
      [1/1] Cythonizing faster_fifo.pyx
      Traceback (most recent call last):
        File "C:\projects\python\test-rl\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
          main()
        File "C:\projects\python\test-rl\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\projects\python\test-rl\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\flore\AppData\Local\Temp\pip-build-env-th443ciw\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:\Users\flore\AppData\Local\Temp\pip-build-env-th443ciw\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "C:\Users\flore\AppData\Local\Temp\pip-build-env-th443ciw\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 39, in <module>
        File "C:\Users\flore\AppData\Local\Temp\pip-build-env-th443ciw\overlay\Lib\site-packages\setuptools\discovery.py", line 113, in find
          convert_path(str(where)),
        File "C:\Users\flore\AppData\Local\Temp\pip-build-env-th443ciw\overlay\Lib\site-packages\setuptools\_distutils\util.py", line 141, in convert_path
          raise ValueError("path '%s' cannot end with '/'" % pathname)
      ValueError: path './' cannot end with '/'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

There seems to be a problem with a path ending with / but I am not sure where the path is coming from. I am working on windows 11.

Cheers, Florentin

ryash072007 commented 1 year ago

Hey mate, unfortunately sf or sample-factory is a linux only thing. So it will never work on windows. Im sorry. I tried WSL and it didnt work. Hence I'll suggest to turn ur direction towards rllib if u have nvidia gpu else sb3. I have been using sb3 and it is quite good. I am trying to improve upon it because edbeeching is a linux user and might not be able to progress further.

visuallization commented 1 year ago

Hey Ryash, thank you for the reply! :)

Okay that's good to know, then I am glad that I didn't try too hard yesterday to make it work on Windows. :D I inititally wanted to use stable baselines but I was not sure if it will work out as expected, as the stable baseline commands in the readme are still marked with a TODO (see screenshot).

I tried to make it work with the commands provided for sample factory and changed the trainer to sb3 and it was training for a short while but exited eventually. Also I wasn't able to visuallize the training, that's why I thought it might not work with sb3 yet or needs a different command.

For example, I would expect
gdrl --trainer=sb3 --env=gdrl --env_path=examples/godot_rl_BallChase/bin/BallChase.exe --num_workers=1 --experiment=BallChase --viz --eval --batched_sampling=True to open the game and visuallize the training.

Do I get something wrong?

Just running gdrl and pressing start in the editor works, but I am not sure which rl library it is using (probably sb3 as it is th one I installed?)

grafik

edbeeching commented 1 year ago

There is an independent stablebaselines3 example in the examples folder. Let me know if you have any issues.

ryash072007 commented 1 year ago

The Default Trainer for training using gdrl is infact sb3. SB3 has less support than the others currently. The only way to use for now is to call the gdrl command without any arguments, then wait till the message about play in the godot editor comes / active on port 11008 comes, after that play the scene in the godot editor. Wait for a few secs and it should work.

ryash072007 commented 1 year ago

I'll try to improve SB3 but that will only start at the end of march when Im free. For now though, sb3 is more than enough.

edbeeching commented 1 year ago

I updated the docs with instructions to run the examples with sb3, let me know if you have any issues.

GeorgeS2019 commented 1 year ago

The Default Trainer for training using gdrl is infact sb3. SB3 has less support than the others currently. The only way to use for now is to call the gdrl command without any arguments,

The correct command line is

gdrl.interactive //without arguments

No game binary has been provided, please press PLAY in the Godot editor
waiting for remote GODOT connection on port 11008