[Question] Need help on exporting the final Policy and ONNX file after training using Robomimic #3964
Replies: 1 comment
-
|
Thank you for posting this. I'll move to our Discussions for follow up. Here is a summary of guidelines that may be of help. Exporting Your Robomimic Policy to ONNX
import torch
# Assume your policy network class is PolicyNetwork and checkpoint path is known
model = PolicyNetwork(...)
model.load_state_dict(torch.load('path_to_your_final_policy.pth'))
model.eval()
# Create a dummy input that matches the input shape your policy expects
dummy_input = torch.randn(1, input_dim) # use correct shape and device
torch.onnx.export(
model,
dummy_input,
"exported_policy.onnx",
input_names=["input"],
output_names=["output"],
dynamic_axes={"input": {0: "batch_size"}, "output": {0: "batch_size"}},
opset_version=13
)This produces an ONNX file that you can use for deployment via inference infrastructure like Isaac Sim or real-robot middleware.123 Combining the Locomotion and Pick-and-Place Policies
Footnotes
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hi,
I have trained a pick and place policy using Robomimic and have got the Final epoch outputs in "PTH" format.
Now similar to Reinforcement learning,
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions