Skip to content

Commit

Permalink
Update stable_baselines_export.py
Browse files Browse the repository at this point in the history
Adds error handling for case of exporting a SAC policy without using single obs (currently not supported).
  • Loading branch information
Ivan-267 authored Aug 22, 2024
1 parent 1df043d commit 95cb1ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions godot_rl/wrappers/onnx/stable_baselines_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def export_model_as_onnx(model, onnx_model_path: str, use_obs_array: bool = Fals
dummy_input = None
onnxable_model = None

if isinstance(model, SAC):
assert use_obs_array, "SAC ONNX export works with use_obs_array=True, MLPPolicy and SBGSingleObsEnv only."

if isinstance(model, PPO):
onnxable_model = OnnxablePolicy(
["obs"],
Expand Down

0 comments on commit 95cb1ad

Please sign in to comment.