Closed Disciple7 closed 1 year ago
补充:以上为使用QAT量化的yolov3_mobilenet_v1_qat,导出为infer模型和serving模型运行结果。不使用TensorRT(不添加--run_mode=trt_int8或--use_trt参数时可正常运行) 后续测试了未量化的yolov3_mobilenet_v1_270e_voc模型,以及yolov3_darkenet53_270e_voc模型,在PaddleInference下进行推理,同样报Pass preln_embedding_eltwise_layernorm_fuse_pass has not been registered.
报错信息如下:
(pdconfig) ubuntu@sunyuke:~/lxd-storage/xzy/PaddleCV/PaddleDetection$ python deploy/python/infer.py --model_dir=./infe
rence_model/yolov3_darknet53_270e_voc_origin --image_file=./dataset/fire_smoke_voc/images/00001.jpg --device=GPU --
run_mode=trt_int8
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:36: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
'nearest': Image.NEAREST,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:37: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
'bilinear': Image.BILINEAR,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:38: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
'bicubic': Image.BICUBIC,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:39: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
'box': Image.BOX,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:40: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
'lanczos': Image.LANCZOS,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:41: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
'hamming': Image.HAMMING
----------- Running Arguments -----------
batch_size: 1
camera_id: -1
cpu_threads: 1
device: GPU
enable_mkldnn: False
image_dir: None
image_file: ./dataset/fire_smoke_voc/images/00001.jpg
model_dir: ./inference_model/yolov3_darknet53_270e_voc_origin
output_dir: output
reid_batch_size: 50
reid_model_dir: None
run_benchmark: False
run_mode: trt_int8
save_images: False
save_mot_txt_per_img: False
save_mot_txts: False
scaled: False
threshold: 0.5
trt_calib_mode: False
trt_max_shape: 1280
trt_min_shape: 1
trt_opt_shape: 640
use_dark: True
use_gpu: False
video_file: None
------------------------------------------
----------- Model Configuration -----------
Model Arch: YOLO
Transform Order:
--transform op: Resize
--transform op: NormalizeImage
--transform op: Permute
--------------------------------------------
Traceback (most recent call last):
File "deploy/python/infer.py", line 773, in <module>
main()
File "deploy/python/infer.py", line 726, in main
enable_mkldnn=FLAGS.enable_mkldnn)
File "deploy/python/infer.py", line 94, in __init__
enable_mkldnn=enable_mkldnn)
File "deploy/python/infer.py", line 563, in load_predictor
predictor = create_predictor(config)
ValueError: (InvalidArgument) Pass preln_embedding_eltwise_layernorm_fuse_pass has not been registered.
[Hint: Expected Has(pass_type) == true, but received Has(pass_type):0 != true:1.] (at /paddle/paddle/fluid/framework/ir/pass.h:242)
(pdconfig) ubuntu@sunyuke:~/lxd-storage/xzy/PaddleCV/PaddleDetection$ python deploy/python/infer.py --model_dir=./infe
rence_model/yolov3_mobilenet_v1_270e_voc_origin --image_file=./dataset/fire_smoke_voc/images/00001.jpg --device=GPU
--run_mode=trt_int8
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:36: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
'nearest': Image.NEAREST,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:37: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
'bilinear': Image.BILINEAR,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:38: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
'bicubic': Image.BICUBIC,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:39: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
'box': Image.BOX,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:40: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
'lanczos': Image.LANCZOS,
/home/ubuntu/anaconda3/envs/pdconfig/lib/python3.7/site-packages/paddle/vision/transforms/functional_pil.py:41: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
'hamming': Image.HAMMING
----------- Running Arguments -----------
batch_size: 1
camera_id: -1
cpu_threads: 1
device: GPU
enable_mkldnn: False
image_dir: None
image_file: ./dataset/fire_smoke_voc/images/00001.jpg
model_dir: ./inference_model/yolov3_mobilenet_v1_270e_voc_origin
output_dir: output
reid_batch_size: 50
reid_model_dir: None
run_benchmark: False
run_mode: trt_int8
save_images: False
save_mot_txt_per_img: False
save_mot_txts: False
scaled: False
threshold: 0.5
trt_calib_mode: False
trt_max_shape: 1280
trt_min_shape: 1
trt_opt_shape: 640
use_dark: True
use_gpu: False
video_file: None
------------------------------------------
----------- Model Configuration -----------
Model Arch: YOLO
Transform Order:
--transform op: Resize
--transform op: NormalizeImage
--transform op: Permute
--------------------------------------------
Traceback (most recent call last):
File "deploy/python/infer.py", line 773, in <module>
main()
File "deploy/python/infer.py", line 726, in main
enable_mkldnn=FLAGS.enable_mkldnn)
File "deploy/python/infer.py", line 94, in __init__
enable_mkldnn=enable_mkldnn)
File "deploy/python/infer.py", line 563, in load_predictor
predictor = create_predictor(config)
ValueError: (InvalidArgument) Pass preln_embedding_eltwise_layernorm_fuse_pass has not been registered.
[Hint: Expected Has(pass_type) == true, but received Has(pass_type):0 != true:1.] (at /paddle/paddle/fluid/framework/ir/pass.h:242)
更新一下:用Paddle Issue#42759提到的方法安装了带TensorRT的PaddleInference whl后能够成功开启trt_int8等run_mode了。但是PaddleServing依然报No OpConverter Type [nearest_interp_v2]错误。
咋解决的啊,为毛没有下文了
确定下安装的paddlepaddle是否支持TensorRT,重新安装下应该就好了: https://www.paddlepaddle.org.cn/inference/v2.3/user_guides/download_lib.html#python
问题确认 Search before asking
bug描述 Describe the Bug
该问题为此Issue的后续,在那之后,由于环境和系统配置比较乱,我重新配置了一个新的系统环境,环境附后。 按照官方教程,在VOC数据集上训练了一个yolov3_mobilenet_v1_270e_voc模型,量化config使用默认的yolov3_mobilenet_v1_qat.yml。按照原Issue指示更新到PaddlePaddle 2.3.0.rc0后,使用TRT_INT8不再报tensorrt_subgraph_pass相关错误,但报另一个Pass错误。
PaddleInference命令和报错如下:
PaddleServing命令和报错如下(会随机报以下两不同错误,出现前提条件不明):
复现环境 Environment
paddlepaddle-gpu=2.3.0.rc0.post101 paddledet=2.3.0 paddleslim=2.2.2 paddle-serving-server-gpu=0.8.3.post101
Ubuntu 18.04 Python 3.7
Nvidia Driver 430.64 CUDA 10.1 cudnn 7.6.5 TensorRT=6.0.1.5
是否愿意提交PR Are you willing to submit a PR?