Skip to content

Conversation

@Ivan-267
Copy link
Collaborator

@Ivan-267 Ivan-267 commented May 15, 2025

Should fix #234

Action order gets sorted alphabetically by spaces.Dict when we give it a dictionary.
As a quick fix without changing other code sections, we convert the dictionary to list.

Still not properly tested for any issues that might be introduced, but it seems to preserve action order when using print(env.action_space). Check the issue for more detail.

Edit:
Personally I only checked once with SB3 for now, will check a bit more (at least with SB3) when I can. Tests passed so hopefully other frameworks will work too.

Seems to work OK in Godot after SB3 training too. We had a similar issue before, fixed by using an OrderedDict then, now as the issue has occurred again, using a list fixes it.

@Ivan-267 Ivan-267 requested review from edbeeching and removed request for edbeeching May 15, 2025 13:22
@Ivan-267 Ivan-267 changed the title Fixed swapped action order in godot_env.py [WIP] swapped action order in godot_env.py May 15, 2025
@Ivan-267 Ivan-267 changed the title [WIP] swapped action order in godot_env.py Fix swapped action order in godot_env.py May 15, 2025
@Ivan-267 Ivan-267 requested a review from edbeeching May 15, 2025 13:41
@Ivan-267 Ivan-267 merged commit effeb25 into main Jun 6, 2025
13 checks passed
@Ivan-267 Ivan-267 deleted the Ivan-267-patch-2 branch June 6, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action order swapped with onnx inference

3 participants