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

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

Open
Rsndmmm opened this issue May 3, 2024 · 0 comments
Open
Assignees

Comments

@Rsndmmm
Copy link

Rsndmmm commented May 3, 2024


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


环境

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

  • 附上详细的问题日志有助于快速定位分析
  • 【模型跑不通】
    按照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>
    )
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