Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.04 KB

6_Convert_Models.md

File metadata and controls

31 lines (22 loc) · 1.04 KB

Convert ONNX model

  • Convert ONNX model file from Pytorch 'pth' model file
docker exec -it centerpointpillar bash

pip install onnx==1.16.0 onnxsim==0.4.36 onnxruntime

cd ~/CenterPointPillar/
mkdir onnx
cd ~/CenterPointPillar/tools
python export_onnx.py --cfg_file cfgs/waymo_models/centerpoint_pillar_inference.yaml --ckpt ../ckpt/checkpoint_epoch_24.pth

  • As a result, create 3 onnx files on the CenterPointPillar/onnx
    • model_raw.onnx: pth를 onnx 로 변환한 순수 버전
    • model_sim.onnx: onnx 그래프 간단화해주는 라이브러리 사용한 버전
    • model.onnx: sim 모델을 gragh surgeon으로 수정한 최종 버전, tensorRT plugin 사용하려면 gragh surgeon이 필수임.

  • Copy Onnx file to the centerpoint/model folder for TensorRT Process
cd ~/CenterPointPillar/
cp onnx/model.onnx centerpoint/model/