Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require sb3 version 2 or newer #148

Merged
merged 9 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Clean up dependencies
run: |
pip uninstall -y stable-baselines3 gymnasium
pip install .[rllib]
pip install ray[rllib]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rllib requires gymnasium==0.26.3 which I why we install our .[rllib] deps, see:

rllib =

- name: Download examples
run: |
make download_examples
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Clean up dependencies
run: |
pip uninstall -y stable-baselines3 gymnasium
pip install .[rllib]
pip install ray[rllib]
- name: Download examples
run: |
make download_examples
Expand Down
2 changes: 1 addition & 1 deletion godot_rl/wrappers/onnx/stable_baselines_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def verify_onnx_export(ppo: PPO, onnx_model_path: str, num_tests=10):
onnx.checker.check_model(onnx_model)

sb3_model = ppo.policy.to("cpu")
ort_sess = ort.InferenceSession(onnx_model_path)
ort_sess = ort.InferenceSession(onnx_model_path, providers=['CPUExecutionProvider'])

for i in range(num_tests):
obs = dict(ppo.observation_space.sample())
Expand Down
3 changes: 2 additions & 1 deletion godot_rl/wrappers/ray_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pathlib
from typing import Callable, List, Optional, Tuple

Expand Down Expand Up @@ -174,7 +175,7 @@ def rllib_training(args, extras):
checkpoint_freq=checkpoint_freq,
checkpoint_at_end=not args.eval,
restore=args.restore,
local_dir=args.experiment_dir or "logs/rllib",
local_dir=os.path.abspath(args.experiment_dir) or os.path.abspath("logs/rllib"),
trial_name_creator=lambda trial: f"{args.experiment_name}" if args.experiment_name else f"{trial.trainable_name}_{trial.trial_id}"
)
if args.export:
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install_requires =
wget
huggingface_hub>=0.10
gymnasium
stable-baselines3
stable-baselines3>=2.0.0
huggingface_sb3
onnx
onnxruntime
Expand Down Expand Up @@ -48,7 +48,6 @@ sf =
sample-factory

rllib =
gymnasium==0.26.3
ray[rllib]

cleanrl =
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def test_rllib_training():
args.env_path = "examples/godot_rl_JumperHard/bin/JumperHard.x86_64"


rllib_training(args, extras)
rllib_training(args, extras)