PaddlePaddle / PaddlePaddle/FastDeploy

在rk3588上推理insightface模型只能使用cpu不能用npu加速

Open
#2,448 0 comments 0 reactions 1 assignee View on GitHub

@rainyfly is already working on this.

Since May 3, 2024.

Dominant language
Python
Stars
3.7k
Forks
756
Avg merge
19h 28m
Merged PRs (30d)
4

Description


温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度


环境

问题日志及出现问题的操作流程

  • 附上详细的问题日志有助于快速定位分析
  • 【模型跑不通】
    按照https://github.com/PaddlePaddle/FastDeploy/blob/develop/examples/vision/faceid/insightface/rknpu2/python/README_CN.md文档测试insightface,使用https://github.com/PaddlePaddle/FastDeploy/blob/develop/examples/vision/faceid/insightface/rknpu2/python/infer_arcface.py脚本,python infer_arcface.py --model ms1mv3_arcface_r100.onnx --face face_0.jpg --face_positive face_1.jpg --face_negative face_2.jpg --device npu 命令推理onnx模型时报错:
    [INFO] fastdeploy/runtime/runtime.cc(326)::CreateOrtBackend Runtime initialized with Backend::ORT in Device::CPU.
    [ERROR] fastdeploy/runtime/backends/ort/ort_backend.cc(401)::Infer Failed to Infer: Unexpected input data type. Actual: (tensor(uint8)) , expected: (tensor(float))
    [ERROR] fastdeploy/vision/faceid/contrib/insightface/base.cc(70)::BatchPredict Failed to inference by runtime.
    [ERROR] fastdeploy/runtime/backends/ort/ort_backend.cc(401)::Infer Failed to Infer: Unexpected input data type. Actual: (tensor(uint8)) , expected: (tensor(float))
    [ERROR] fastdeploy/vision/faceid/contrib/insightface/base.cc(70)::BatchPredict Failed to inference by runtime.
    [ERROR] fastdeploy/runtime/backends/ort/ort_backend.cc(401)::Infer Failed to Infer: Unexpected input data type. Actual: (tensor(uint8)) , expected: (tensor(float))
    [ERROR] fastdeploy/vision/faceid/contrib/insightface/base.cc(70)::BatchPredict Failed to inference by runtime.
    /home/pi/FastDeploy/examples/vision/faceid/insightface/python/infer_npu.py:12: RuntimeWarning: invalid value encountered in scalar divide
    return mul_ab / (mul_a * mul_b)
    FaceRecognitionResult: [Empty Result]FaceRecognitionResult: [Empty Result]FaceRecognitionResult: [Empty Result]Cosine 01: nan
    Cosine 02: nan
    RuntimeOption(
    backend : Backend.ORT
    cpu_thread_num : -1
    device : Device.CPU
    device_id : 0
    external_stream : None
    model_file : ms1mv3_arcface_r100.onnx
    model_format : ModelFormat.ONNX
    model_from_memory : False
    openvino_option : <fastdeploy.libs.fastdeploy_main.OpenVINOBackendOption object at 0x7f8c2e48f0>
    ort_option : <fastdeploy.libs.fastdeploy_main.OrtBackendOption object at 0x7f8c2e48f0>
    paddle_infer_option : <fastdeploy.libs.fastdeploy_main.PaddleBackendOption object at 0x7f8c2e48f0>
    paddle_lite_option : <fastdeploy.libs.fastdeploy_main.LiteBackendOption object at 0x7f8c2e48f0>
    params_file :
    poros_option : <fastdeploy.libs.fastdeploy_main.PorosBackendOption object at 0x7f8c2e48f0>
    trt_option : <fastdeploy.libs.fastdeploy_main.TrtBackendOption object at 0x7f8c2e48f0>
    )

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.