Skip to content

Commit aec2f22

Browse files
committed
onnx export: properly handle obs_key
1 parent 12ab0d4 commit aec2f22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

godot_rl/wrappers/onnx/stable_baselines_export.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ def export_model_as_onnx(model, onnx_model_path: str, use_obs_array: bool = Fals
8181
args=(dummy_input, torch.zeros(1).float()),
8282
f=onnx_model_path,
8383
opset_version=17,
84-
input_names=["obs", "state_ins"],
84+
input_names=obs_keys + ["state_ins"],
8585
output_names=["output", "state_outs"],
8686
dynamic_axes={
87-
"obs": {0: "batch_size"},
87+
**{sub_obs: {0: "batch_size"} for sub_obs in obs_keys},
8888
"state_ins": {0: "batch_size"}, # variable length axes
8989
"output": {0: "batch_size"},
9090
"state_outs": {0: "batch_size"},

0 commit comments

Comments
 (0)