argman / EAST

A tensorflow implementation of EAST text detector
GNU General Public License v3.0
3.01k stars 1.05k forks source link

convert to tensorrt #373

Open zzypeak opened 3 years ago

zzypeak commented 3 years ago

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