PaddlePaddle / Paddle-Lite

PaddlePaddle High Performance Deep Learning Inference Engine for Mobile and Edge (飞桨高性能深度学习端侧推理引擎)
https://www.paddlepaddle.org.cn/lite
Apache License 2.0
6.97k stars 1.61k forks source link

官方的yolov5n模型我自己用opt转换后使用报错 #10580

Open leslie2046 opened 3 weeks ago

leslie2046 commented 3 weeks ago

为使您的问题得到快速解决,在建立 Issue 前,请您先通过如下方式搜索是否有相似问题: 历史 issue, FAQ 文档, 官方文档

建立 issue 时,为快速解决问题,请您根据使用情况给出如下信息:

leslie2046 commented 3 weeks ago

python tools/export_model.py -c configs/yolov5/yolov5_n_300e_coco.yml \

-o weights=output/yolov5_n_300e_coco/yolov5_n_300e_coco.pdparams --output_dir=output_inference /home/czr/anaconda3/envs/paddleyolo2/lib/python3.9/site-packages/setuptools/command/easy_install.py:41: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources /home/czr/anaconda3/envs/paddleyolo2/lib/python3.9/site-packages/pkg_resources/init.py:3154: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) [10/30 14:40:55] ppdet.engine INFO: Model Params : [1.872157] M. [10/30 14:40:55] ppdet.utils.checkpoint INFO: Finish loading model weights: output/yolov5_n_300e_coco/yolov5_n_300e_coco.pdparams loading annotations into memory... Done (t=0.65s) creating index... index created! [10/30 14:40:56] ppdet.engine INFO: Export inference config file to output_inference/yolov5_n_300e_coco/infer_cfg.yml [10/30 14:41:01] ppdet.engine INFO: Export model and saved in output_inference/yolov5_n_300e_coco

leslie2046 commented 3 weeks ago

./opt_linux --valid_targets=arm,opencl --model_file=output_inference/yolov5_n_300e_coco/model.pdmodel --param_file=output_inference/yolov5_n_300e_coco/model.pdiparams --optimize_out=output_inference/yolov5_n_300e_coco/model Loading topology data from output_inference/yolov5_n_300e_coco/model.pdmodel Loading params data from output_inference/yolov5_n_300e_coco/model.pdiparams

  1. Model is successfully loaded!
  2. Model is optimized and saved into output_inference/yolov5_n_300e_coco/model.nb successfully
leslie2046 commented 3 weeks ago

yolov5_n_300e_coco.zip 这是model.nb

hong19860320 commented 3 weeks ago

可以尝试使用 release note 最新的 2.14-rc opt 工具和 Paddle Lite 库试试哈~ https://github.com/PaddlePaddle/Paddle-Lite/releases image

leslie2046 commented 3 weeks ago

可以尝试使用 release note 最新的 2.14-rc opt 工具和 Paddle Lite 库试试哈~ https://github.com/PaddlePaddle/Paddle-Lite/releases image

python tools/export_model.py -c configs/yolov5/yolov5_n_300e_coco.yml -o weights=output/yolov5_n_300e_coco/yolov5_n_300e_coco.pdparams --output_dir=output_inference ./opt_linux_x86_2.14rc --valid_targets=opencl,arm --model_file=output_inference/yolov5_n_300e_coco/model.pdmodel --param_file=output_inference/yolov5_n_300e_coco/model.pdiparams --optimize_out=output_inference/yolov5_n_300e_coco/model --optimize_out_type=naive_buffer 然后PaddleLiteDemo里也换成了v2.14-rc版本的库,依然报错

leslie2046 commented 3 weeks ago

现在能跑起来了,但是会时不时的卡几秒钟,卡顿的时候预测耗时达到好几秒

leslie2046 commented 2 weeks ago

https://github.com/PaddlePaddle/Paddle-Lite/issues/10585