Skip to content

Commit 3131f6c

Browse files
committed
Adds onnx model instructions
1 parent 448f50a commit 3131f6c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ This quickstart guide will get you up and running using the Godot RL Agents libr
2828
pip install godot-rl
2929
```
3030

31-
1. Download one, or more of [examples](https://github.com/edbeeching/godot_rl_agents_examples), such as BallChase, JumperHard, FlyBy.
31+
2. Download one, or more of [examples](https://github.com/edbeeching/godot_rl_agents_examples), such as BallChase, JumperHard, FlyBy.
3232

3333
```bash
3434
gdrl.env_from_hub -r edbeeching/godot_rl_JumperHard
3535
```
36+
You may need to example run permissions on the game executable. `chmod +x examples/godot_rl_JumperHard/bin/JumperHard.x86_64`
3637

37-
1. Train and visualize
38+
3. Train and visualize
3839

3940
```bash
4041
gdrl --env=gdrl --env_path=examples/godot_rl_JumperHard/bin/JumperHard.x86_64 --viz
@@ -54,6 +55,12 @@ There is a dedicated tutorial on creating custom environments [here](docs/CUSTOM
5455

5556
If you face any issues getting started, please reach out on our discord or raise a github issue.
5657

58+
### Exporting and loading your trained agent in onnx format:
59+
The latest version of the library provides experimental support for onnx models with the Stable Baselines 3 and rllib training frameworks.
60+
1. First run train you agent using the sb3 example on the [github repo](https://github.com/edbeeching/godot_rl_agents/blob/main/examples/stable_baselines3_example.py), enabling the option `--onnx_export_path=GameModel.onnx`
61+
2. Then, using the **mono version** of the Godot Editor, add the onnx model path to the sync node. If you do not seen this option you may need to download the plugin from [source](https://github.com/edbeeching/godot_rl_agents_plugin)
62+
3. The game should now load and run using the onnx model. If you are having issues building the project, ensure that the contents of the `.csproj` and `.sln` files in you project match that those of the plugin [source](https://github.com/edbeeching/godot_rl_agents_plugin).
63+
5764
## Advanced usage
5865
[https://user-images.githubusercontent.com/7275864/209160117-cd95fa6b-67a0-40af-9d89-ea324b301795.mp4](https://user-images.githubusercontent.com/7275864/209160117-cd95fa6b-67a0-40af-9d89-ea324b301795.mp4)
5966

0 commit comments

Comments
 (0)