convert to tensorrt
zzypeak opened this issue · 0 comments
I can convert to onnx by the follow command :
python -m tf2onnx.convert --checkpoint model_zoo/model.ckpt.meta --output ckpt_model.onnx --inputs input_images:0 --outputs model_0/feature_fusion/Conv_7/Sigmoid:0,model_0/feature_fusion/concat_3:0 --opset=11
but when I convert the onnx model to tensorrt, an error happen:
[04/07/2021-10:36:49] [V] [TRT] ImporterContext.hpp:97: Registering tensor: input_images:0 for ONNX tensor: input_images:0 [04/07/2021-10:36:49] [V] [TRT] ModelImporter.cpp:90: Importing initializer: roi__2181 ERROR: ModelImporter.cpp:92 In function parseGraph: [8] Assertion failed: convertOnnxWeights(initializer, &weights, ctx) [04/07/2021-10:36:49] [E] Failed to parse onnx file [04/07/2021-10:36:49] [E] Parsing model failed [04/07/2021-10:36:49] [E] Engine creation failed [04/07/2021-10:36:49] [E] Engine set up failed
the command
trtexec --explicitBatch --onnx=model_zoo/ckpt_model.onnx --minShapes=input:1x224x224x3 --optShapes=input:32x224x224x3 --maxShapes=input:32x512x512x3 --saveEngine=model.batch1-32.engine --verbose