Paddle-Lite opt转化报错

jogvjijk  于 2022-04-21  发布在  Java
关注(0)|答案(12)|浏览(430)

我最近刚刚上手paddel框架,希望在树莓派上使用paddle-lite部署一些模型,使用python语言
首先希望能用paddel-lite部署官方教程mobilenet_v1之外的任意一个网络,选用了paddelDetection内的ppyolo_tiny,下载了官方权重文件夹ppyolo_tiny_quant,内含__model__和__params__文件,但当我使用树莓派执行:
paddle_lite_opt --model_file=./model--param_file=./params--valid_targets=arm --optimize_out_type=naive_buffer --optimize_out=ppyolo_tiny_opt
得到报错:
[I 5/19 20: 4:14.175 .../pi/paddle-lite/lite/core/device_info.cc:1097 Setup] ARM multiprocessors name: MODEL NAME : ARMV7 PROCESSOR REV 3 (V7L)
HARDWARE : BCM2711

[I 5/19 20: 4:14.175 .../pi/paddle-lite/lite/core/device_info.cc:1098 Setup] ARM multiprocessors number: 4
[I 5/19 20: 4:14.175 .../pi/paddle-lite/lite/core/device_info.cc:1100 Setup] ARM multiprocessors ID: 0, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72
[I 5/19 20: 4:14.175 .../pi/paddle-lite/lite/core/device_info.cc:1100 Setup] ARM multiprocessors ID: 1, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1100 Setup] ARM multiprocessors ID: 2, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1100 Setup] ARM multiprocessors ID: 3, max freq: 1500, min freq: 1500, cluster ID: 0, CPU ARCH: A72
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1106 Setup] L1 DataCache size is:
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1108 Setup] 32 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1108 Setup] 32 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1108 Setup] 32 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1108 Setup] 32 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1110 Setup] L2 Cache size is:
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1112 Setup] 512 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1112 Setup] 512 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1112 Setup] 512 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1112 Setup] 512 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1114 Setup] L3 Cache size is:
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1116 Setup] 0 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1116 Setup] 0 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1116 Setup] 0 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1116 Setup] 0 KB
[I 5/19 20: 4:14.176 .../pi/paddle-lite/lite/core/device_info.cc:1118 Setup] Total memory: 1858700KB
[I 5/19 20: 4:14.254 /home/pi/paddle-lite/lite/api/cxx_api.cc Build:295] Load model from file.
[F 5/19 20: 4:14.335 ...home/pi/paddle-lite/lite/core/program.cc:331 Build] Check failed: op: no Op found for hard_sigmoid
Aborted

这是paddle-lite不支持自己ppyolo里的hard_sigmoid激活函数吗?

pgx2nnw8

pgx2nnw81#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网文档常见问题历史Issue来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQ and Github Issue to get the answer.Have a nice day!

y0u0uwnf

y0u0uwnf2#

您好,新版本已经发布,请使用 v2.9 版本进行尝试~~

8mmmxcuj

8mmmxcuj3#

您好!我想继续请教几个问题!
-------1.我编译了v2.9版本的paddlelite,依然显示不支持hard_sigmoid
-------2.另外我想请问
Error: This model is not supported, because 1 ops are not supported on 'arm'. These unsupported ops are: 'assign'
这个‘assign’也是不支持的层的问题吗?我使用的是pytorch的模型通过x2paddle转化成的paddlepaddle模型,原网络没有什么奇怪的层,除去普通的卷积、relu、bn、全连接等就只有分组卷积可能稍微不一样一点,是这个问题?
-------3.是否aarch64只能安装paddlelite框架进行前向推理?Paddlepaddle、PaddleDetection能装上吗?

iyzzxitl

iyzzxitl4#

我编译了v2.9版本的paddlelite,依然显示不支持hard_sigmoid

  • 编译时请选择 --build_extra=ON

Error: This model is not supported, because 1 ops are not supported on 'arm'. These unsupported ops are: 'assign'

  • 我看代码中是有的,请paddle_lite_opt --print_all_ops=true 确认下是否有assign

是否aarch64只能安装paddlelite框架进行前向推理?Paddlepaddle、PaddleDetection能装上吗?

  • 都可以安装
ar5n3qh5

ar5n3qh55#

针对问题2,在paddle_lite_opt打印出的节点中有看到assign_value,也有看到hard_sigmoid,不过没有单独叫assign的,这是编译的问题吗?

qij5mzcb

qij5mzcb6#

这是编译的问题吗?

可能是你编译的分支不太对?

lc8prwob

lc8prwob7#

我编译前执行了
git checkout v2.9 和 rm -rf third-party
执行git status记得显示过HEAD detached at v2.9
这样有问题吗?

vmdwslir

vmdwslir8#

我试了下2.9是对的。
你贴下编译的脚本命令?

./lite/tools/build.sh build_optimize_tool 我是这样编的

ajsxfq5m

ajsxfq5m9#

之前的编译是:
./lite/tools/build_linux.sh --with_python=ON,然后再pip install了编译后的whl文件
现在正在重新编译,是用的:
./lite/tools/build_linux.sh --with_python=ON with_extra=ON
build_optimize_tool是必须在编译时执行的吗?我是不是应该执行
./lite/tools/build.sh build_optimize_tool --with_python=ON with_extra=ON

mefy6pfw

mefy6pfw10#

./lite/tools/build_linux.sh --with_python=ON with_extra=ON

就按照这个来,应该是对的

isr3a4wc

isr3a4wc11#

好滴!非常感谢!

h9a6wy2h

h9a6wy2h12#

1381 illegal hardware instruction paddle_lite_opt --model_file=mnist.pdopt

直接报错了。。你们遇到过吗

相关问题