Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
leslie2046 opened this issue Oct 30, 2024 · 7 comments
Open

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

leslie2046 opened this issue Oct 30, 2024 · 7 comments
Assignees

Comments

@leslie2046
Copy link

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

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

  • 标题:简洁、精准描述您的问题,例如“ssd 模型转换报错”
  • 版本、环境信息:
       1)Paddle Lite 版本:请提供您的 Paddle Lite 版本号(如v2.10)或 CommitID
    paddle lite:v2.11
    paddlepaddle-gpu 2.4.2
       2)Host 环境:请描述 Host 系统类型、OS 版本,如 Mac OS 10.14、Ubuntu 18.04
    host centos
  • 模型信息
       1)模型名称 yolov5n
    2)模型链接
    https://paddledet.bj.bcebos.com/models/yolov5_n_300e_coco.pdparams
  • 复现信息:提供 OPT 使用命令或方法,用于复现问题
  1. 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
  2. ./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
@leslie2046
Copy link
Author

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
Copy link
Author

./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
Copy link
Author

yolov5_n_300e_coco.zip
这是model.nb

@hong19860320
Copy link
Collaborator

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

@leslie2046
Copy link
Author

可以尝试使用 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
Copy link
Author

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

@leslie2046
Copy link
Author

#10585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants