BEVFormer_tensorrt icon indicating copy to clipboard operation
BEVFormer_tensorrt copied to clipboard

can not use onnxsim

Open shaoqb opened this issue 2 years ago • 3 comments

image

code:

import os import onnx import torch from onnxsim import simplify

onnx_file = "checkpoints/onnx/bevformer_tiny_epoch_24_cp.onnx" onnx_sim_path = onnx_file.replace(".onnx", "_sim.onnx") model = onnx.load(onnx_file) model_sim, check = simplify(model) assert check, "Simplified ONNX model could not be validated" onnx.save(model_sim, onnx_sim_path)

shaoqb avatar May 17 '23 09:05 shaoqb

The custom plugins are only for TensorRT. They don't support ONNXRuntime.

DerryHub avatar May 17 '23 11:05 DerryHub

Do you have any experience or suggestion if I want to use onnxsim?

shaoqb avatar May 18 '23 01:05 shaoqb

You can use the cfg without custom plugins.

DerryHub avatar May 18 '23 04:05 DerryHub