PaddlePaddle / PaddlePaddle/FastDeploy
【PPHGNet模型转换RKNN模型】RK3588上面infer.py执行预测报错
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 756
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 4
Description
温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度
环境
【FastDeploy版本】: 使用官网提供的C++在rk3588上面编译 fastdeploy
【编译命令】 使用官网提供的C++在rk3588上面编译 fastdeploy
【系统平台】: Linux x64(Ubuntu 20.04)
【硬件】: RK3588
【编译语言】: Python3.9
问题日志及出现问题的操作流程
我们需要PPHGNet samll版 分类模型 的rknn模型转换支持,尝试使用现在公开的 ResNet50_vd
https://github.com/PaddlePaddle/FastDeploy/tree/develop/examples/vision/classification/paddleclas/rockchip/rknpu2
但是转换成rknn模型后运行 infer.py 发生报错。(报错日志下面粘贴)
1.请问现在是不是还没有支持PPHGNet模型
2.什么时候可以支持
3.现阶段通过其他方式 是否可以实现PPHGNet模型的rknn模型转换并正常输出预测结果
(rk3588_py3.9) topeet@iTOP-RK3588:~/ml/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/python $ python infer.py
[INFO] fastdeploy/runtime/backends/rknpu2/rknpu2_backend.cc(81)::GetSDKAndDeviceVersion rknpu2 runtime version: 1.4.2b0 (c5d79ccf9@2023-02-14T17:55:39)
[INFO] fastdeploy/runtime/backends/rknpu2/rknpu2_backend.cc(82)::GetSDKAndDeviceVersion rknpu2 driver version: 0.7.2
index=0, name=x, n_dims=4, dims=[1, 224, 224, 3], n_elems=150528, size=301056, fmt=NHWC, type=FP16, qnt_type=AFFINE, zp=0, scale=1.000000, pass_through=0
index=0, name=softmax_1.tmp_0, n_dims=2, dims=[1, 7, 0, 0], n_elems=7, size=14, fmt=UNDEFINED, type=FP32, qnt_type=AFFINE, zp=0, scale=1.000000, pass_through=0
[INFO] fastdeploy/runtime/runtime.cc(341)::CreateRKNPU2Backend Runtime initialized with Backend::RKNPU2 in Device::RKNPU.
[WARNING] fastdeploy/runtime/backends/rknpu2/rknpu2_backend.cc(420)::InitRKNNTensorMemory The input tensor type != model's inputs type.The input_type need FP16,but inputs[0].type is UINT8
E RKNN: [14:02:35.123] rknn_set_io_mem, input memory size(57510) < model input size(150528)
[ERROR] fastdeploy/runtime/backends/rknpu2/rknpu2_backend.cc(441)::InitRKNNTensorMemory The function(rknn_set_io_mem) failed! ret=-1
[ERROR] fastdeploy/runtime/backends/rknpu2/rknpu2_backend.cc(474)::Infer Init tensor memory failed.
Segmentation fault (core dumped)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with examples/vision/classification/paddleclas/rockchip/rknpu2/python/infer.py and review the pasted RKNN runtime logs. Compare the model's FP16 input details with the UINT8 input allocation that fails, then verify the supported conversion path for PPHGNet. Done means the converted model runs inference on RK3588 without the tensor-memory error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100