PaddlePaddle / PaddleSeg

Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, 3D Segmentation, etc.
https://arxiv.org/abs/2101.06175
Apache License 2.0
8.66k stars 1.68k forks source link

使用PaddleSeg推理(infer.py)出现的问题 #1720

Closed LarryHYQ closed 2 years ago

LarryHYQ commented 2 years ago

2022-01-16 13:13:51 [INFO] Use GPU 2022-01-16 13:13:51 [INFO] Use TRT 2022-01-16 13:13:51 [INFO] Use manual set dynamic shape Traceback (most recent call last): File "deploy/python/infer.py", line 393, in main(args) File "deploy/python/infer.py", line 380, in main predictor = Predictor(args) File "deploy/python/infer.py", line 137, in init self.predictor = create_predictor(self.pred_cfg) ValueError: (InvalidArgument) Pass tensorrt_subgraph_pass has not been registered. Please use the paddle inference library compiled with tensorrt or disable the tensorrt engine in inference configuration! [Hint: Expected Has(pass_type) == true, but received Has(pass_type):0 != true:1.] (at /paddle/paddle/fluid/framework/ir/pass.h:236)

(infer代码没有改动,命令行输入的是:!python deploy/python/infer.py --config output_quant/segformer_quant/deploy.yaml --image_path ./../../data/data_2022_baseline/JPEGImages --batch_size 1 --save_dir output_quant/result_quant --use_trt True --precision int8)

juncaipeng commented 2 years ago

请参考文档安装支持trt的whl包:https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.3/docs/deployment/inference/python_inference.md

然后下载trt包,进行配置。