From 5f7d4b9fe17515969b4088b0c554eb456e3a774d Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Mon, 23 Aug 2021 08:52:42 +0000 Subject: [PATCH] fix trt dynamic shape --- tools/infer/utility.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 1c822800..93b54505 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -231,13 +231,13 @@ def create_predictor(args, mode, logger): max_input_shape.update(max_pact_shape) opt_input_shape.update(opt_pact_shape) elif mode == "rec": - min_input_shape = {"x": [args.rec_batch_num, 3, 32, 10]} + min_input_shape = {"x": [1, 3, 32, 10]} max_input_shape = {"x": [args.rec_batch_num, 3, 32, 2000]} - opt_input_shape = {"x": [args.rec_batch_num, 3, 32, 320]} + opt_input_shape = {"x": [512, 3, 32, 320]} elif mode == "cls": - min_input_shape = {"x": [args.rec_batch_num, 3, 48, 10]} + min_input_shape = {"x": [1, 3, 48, 10]} max_input_shape = {"x": [args.rec_batch_num, 3, 48, 2000]} - opt_input_shape = {"x": [args.rec_batch_num, 3, 48, 320]} + opt_input_shape = {"x": [512, 3, 48, 320]} else: min_input_shape = {"x": [1, 3, 10, 10]} max_input_shape = {"x": [1, 3, 1000, 1000]} -- GitLab