Adds argument to set obs key to stable_baselines_export.py #212
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the ability to change the obs key used when exporting to onnx.
Usage:
1 - In SB3 example script, find
export_model_as_onnx
method, and inside it set theobs_key
, e.g.:(recommended to use a single key for now, as that's what inference supports for now)
2 - In sync node in GDRL plugin in Godot, find the
_inference_process:
method and set the correct key, e.g.:(this should also be adjustable in the future for each agent, but as we support only one key, it's currently only necessary for the camera sensor so the Python server can detect it as image obs and run needed processing, in other cases there's no advantage from renaming the obs key)
Note
If you don't set the key or modify anything,
obs
will be used by default as before. This is the default which all examples use.Note
Onnx export/inference with the camera sensor is not guaranteed to work with this update. SB3/Rllib and other frameworks can do their own pre-processing which adds complexity to the implementation. However, this PR is still a required step toward it.