Skip to content
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

export model to onnx #17

Open
HuangVictorAuto opened this issue Mar 10, 2022 · 1 comment
Open

export model to onnx #17

HuangVictorAuto opened this issue Mar 10, 2022 · 1 comment

Comments

@HuangVictorAuto
Copy link

HuangVictorAuto commented Mar 10, 2022

Hi, Nvidia AI team. thanks for your opensource sample code for deploying the pointpillar on Xavier.
By the export to onnx part, I have a question. How can you ensure you only export the middel part of the network(after voxelization and encode to 10 feature per pillar), not the whole part which include voxelization, pillar feature extraction, scatter to bev, backbone, postprocess?

 torch.onnx.export(model,                   # model being run
          (dummy_voxel_features, dummy_voxel_num_points, dummy_coords), # model input (or a tuple for multiple inputs)
          "./pointpillar.onnx",    # where to save the model (can be a file or file-like object)
          export_params=True,        # store the trained parameter weights inside the model file
          opset_version=11,          # the ONNX version to export the model to
          do_constant_folding=True,  # whether to execute constant folding for optimization
          keep_initializers_as_inputs=True,
          input_names = ['input', 'voxel_num_points', 'coords'],   # the model's input names
          output_names = ['cls_preds', 'box_preds', 'dir_cls_preds'], # the model's output names
          )

thanks!

@OrcunCanDeniz
Copy link

They're using onnx-graphsurgeon to drop those operation after exporting model as whole.

Relevant script;
https://github.com/NVIDIA-AI-IOT/CUDA-PointPillars/blob/main/tool/simplifier_onnx.py

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

No branches or pull requests

2 participants