-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--onnx_export_path fails if observations are not stored in property named "obs" #211
Comments
Hello, thanks for reporting this, I have been aware of this limitation due to the implementation, we use "obs" in all of the examples except the camera one. Also onnx inference was implemented to use 'obs'. The camera example is currently known not to be exportable with SB3 to onnx. I will apply a fix for testing the export so it at least allows changing the key name and make a PR, however it still doesn't guarantee that the camera export will work properly with SB3. Still, it's one step closer. I have previously tested it with Rllib: edbeeching/godot_rl_agents_examples#32, but, although it worked, even there there might be some pre-processing done as SB3 does which we don't yet do exactly the same in our onnx inference code (there's more to test and check). Until all of this is supported, we can also use |
I added the change, PR here: #212 This still isn't well tested (only quickly), feel free to check if it works well with a change in the obs key. It does not guarantee that the camera obs export to onnx will work however, it just adds this first step and allows you to use a different name for the key. |
Hi, I just tested your changes. Unfortunately I still get |
Is this with camera sensor? So far I tried with vector obs only, although it was a brief test. Did you apply the same changes as in the PR usage guide? #212 Also, does it work fine with the default obs key (without adding any arguments for the key to |
I tried to run the Virtual Camera example and use the
--onnx_export_path
argument. But it fails withKeyError: 'camera_2d'
.camera_2d
is the name of the obs property here. In other examples where observations are stored inside a property namedobs
this error does not occur. I tried the RobotFPS example aswell whereobs
is used and it worked. But then I renamedobs
torobot
inget_obs()
andget_obs_space()
and it failed withKeyError: 'robot'
.Steps to reproduce:
python examples/stable_baselines3_example.py --timesteps=400 --onnx_export_path=model.onnx
(I had to renameexport_model_as_onnx
toexport_ppo_model_as_onnx
for this step, because this rename was not published to pip yet I think)The text was updated successfully, but these errors were encountered: