When doing Python training or inference, because of the conversion, the value for action "1" will be sent to action "2" instead.
When doing onnx inference, the actions will have the same order as defined in the action space method, which means there will be a mismatch when trying to run onnx inference in any env where the action names are not ordered alphabetically.
I ran into this issue in one of my experiments, and was able to solve it by changing the order of actions as defined to be alphabetic.
The same issue happens when trying to run inference on e.g. FlyBy where the actions are not ordered alphabetically.
This was checked with Godot_v4.2-rc2_mono_win64.
Issue: When defining the action space, action names need to be defined in alphabetic order, e.g.
Otherwise the action space order sent to Python by the sync node will be different (it seems to be sorted alphabetically) after the dictionary goes through the
JSON.stringify
method: https://github.com/edbeeching/godot_rl_agents_plugin/blob/main/addons/godot_rl_agents/sync.gd#L178So if e.g. the order defined in Godot is:
When doing Python training or inference, because of the conversion, the value for action "1" will be sent to action "2" instead.
When doing onnx inference, the actions will have the same order as defined in the action space method, which means there will be a mismatch when trying to run onnx inference in any env where the action names are not ordered alphabetically.
I ran into this issue in one of my experiments, and was able to solve it by changing the order of actions as defined to be alphabetic. The same issue happens when trying to run inference on e.g.
FlyBy
where the actions are not ordered alphabetically.