You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I trained SAC model in SB3 and I defined custom gym environment for that. After training the model, I wanted to import it to Matlab. I considered below approaches:
I used clip action in my custom gym environment. Since ONNX does not support post processing, like clipping, the output of onnx was not correct and applying clip on the generated onnx output gave nonsense result.
SB3 using pytorch and my project is not image classification or segmentation models to be supported by importNetworkFromPyTorchcan in Matlab.
I think Tensorflow does not have this limitation in Matlab. I tried to switch to SB2 to have a model in tensorflow but SB2 needs tensorflow==1.5 and apparently I need to downgrade python version from 3.8 to lower versions.
Manually building the network by optimum weights and biases, which is a bit time consuming because I have 4 models.
Do you have any recommendation to facilitate importing trained model from SB3 to Matlab.
Thank you
Checklist
I have checked that there is no similar issue in the repo
I used clip action in my custom gym environment. Since ONNX does not support post processing, like clipping, the output of onnx was not correct and applying clip on the generated onnx output gave nonsense result.
Thank you for your response.
I figure out that in the source code, specifically in the common/policies.py file and the predict function, there are additional steps, such as the unscale_action function.
This function rescale the actions produced by the model to fit within the range [low, high], which corresponds to the lower and upper limits of the action space. After applying this function to the output of the ONNX model, I was able to generate the same output that the model.predict function produces.
❓ Question
Hi,
I trained SAC model in SB3 and I defined custom gym environment for that. After training the model, I wanted to import it to Matlab. I considered below approaches:
Do you have any recommendation to facilitate importing trained model from SB3 to Matlab.
Thank you
Checklist
The text was updated successfully, but these errors were encountered: