未验证 提交 aedeb28a 编写于 作者: littletomatodonkey's avatar littletomatodonkey 提交者: GitHub

fix re bug (#7288)

上级 dff52225
...@@ -225,23 +225,24 @@ def create_predictor(args, mode, logger): ...@@ -225,23 +225,24 @@ def create_predictor(args, mode, logger):
min_subgraph_size, # skip the minmum trt subgraph min_subgraph_size, # skip the minmum trt subgraph
use_calib_mode=False) use_calib_mode=False)
# collect shape # collect shape
if args.shape_info_filename is not None: if args.shape_info_filename is not None:
if not os.path.exists(args.shape_info_filename): if not os.path.exists(args.shape_info_filename):
config.collect_shape_range_info(args.shape_info_filename) config.collect_shape_range_info(
logger.info( args.shape_info_filename)
f"collect dynamic shape info into : {args.shape_info_filename}" logger.info(
) f"collect dynamic shape info into : {args.shape_info_filename}"
)
else:
logger.info(
f"dynamic shape info file( {args.shape_info_filename} ) already exists, not need to generate again."
)
config.enable_tuned_tensorrt_dynamic_shape(
args.shape_info_filename, True)
else: else:
logger.info( logger.info(
f"dynamic shape info file( {args.shape_info_filename} ) already exists, not need to generate again." f"when using tensorrt, dynamic shape is a suggested option, you can use '--shape_info_filename=shape.txt' for offline dygnamic shape tuning"
) )
config.enable_tuned_tensorrt_dynamic_shape(
args.shape_info_filename, True)
else:
logger.info(
f"when using tensorrt, dynamic shape is a suggested option, you can use '--shape_info_filename=shape.txt' for offline dygnamic shape tuning"
)
elif args.use_xpu: elif args.use_xpu:
config.enable_xpu(10 * 1024 * 1024) config.enable_xpu(10 * 1024 * 1024)
......
...@@ -39,7 +39,7 @@ from ppocr.utils.visual import draw_re_results ...@@ -39,7 +39,7 @@ from ppocr.utils.visual import draw_re_results
from ppocr.utils.logging import get_logger from ppocr.utils.logging import get_logger
from ppocr.utils.utility import get_image_file_list, load_vqa_bio_label_maps, print_dict from ppocr.utils.utility import get_image_file_list, load_vqa_bio_label_maps, print_dict
from tools.program import ArgsParser, load_config, merge_config from tools.program import ArgsParser, load_config, merge_config
from tools.infer_vqa_token_ser import SerPredictor from tools.infer_kie_token_ser import SerPredictor
class ReArgsParser(ArgsParser): class ReArgsParser(ArgsParser):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册