HyperInspire / InspireFace

InspireFace is a cross-platform face recognition SDK developed in C/C++, supporting multiple operating systems and various backend types for inference, such as CPU, GPU, and NPU.
74 stars 14 forks source link

Pre-compiling Gundam_RV1109 Model on RV1126 Fails: Request for Test Pre-Compiled Models or Guidance for Testing on RV1126 #70

Closed Thonnn closed 1 week ago

Thonnn commented 5 months ago

I am trying to port the project to run on an RV1126 device, but I encountered the following issues:

  1. Slow Model Loading with Full RKNPU Driver: When using the full RKNPU driver, face recognition model loading is very slow, resulting in slow recognition speed. Therefore, I want to pre-compile the model.

  2. Unpacking Gundam_RV1109 Model Files: I have unpacked the GundamRV1109 model files, obtaining the \_inspire_ file and eight other model files. I noticed that the _02 file is not actually used, and the _06_ file is an mnn model that also doesn't seem to be used. Therefore, I plan to pre-compile the remaining six models, but I encountered some issues.

  3. Pre-compiling Models: Pre-compiling the _00 model was successful, but I encountered issues while pre-compiling the _03 and _01 _04 _05 _07 models.

  4. _03_ Model Pre-compiling Error:

    root@7a64f1381911:/thonnn/rktools# python3 export_rknn_precompile_model.py Gundam_RV1109/_03_r18_Glint360K_fixed Gundam_RV1109_Output/_03_r18_Glint360K_fixed
    Use default target: rv1126
    W rknn-toolkit version: 1.7.5
    --> Loading RKNN model
    done
    --> Init runtime environment
    I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:36)
    D RKNNAPI: ==============================================
    D RKNNAPI: RKNN VERSION:
    D RKNNAPI:   API: 1.7.5 (bb79b30 build: 2023-06-20 09:54:19)
    D RKNNAPI:   DRV: 1.7.5 (bb79b30 build: 2023-07-18 10:56:54)
    D RKNNAPI: ==============================================
    done
    E RKNNAPI: rknn_query,  recv(MsgIoctl IOCTL_CMD_RKNN_PRECOMPILE) fail!
    E Catch exception when get precompile model
    E Traceback (most recent call last):
    E   File "rknn/api/rknn_base.py", line 1317, in rknn.api.rknn_base.RKNNBase.get_precompile_model_on_hardware
    E   File "rknn/api/rknn_runtime.py", line 716, in rknn.api.rknn_runtime.RKNNRuntime.get_precompile_model
    E Exception: Get precompile length failed. Error code: RKNN_ERR_DEVICE_UNAVAILABLE
    E Please feedback the detailed log file <log_feedback_to_the_rknn_toolkit_dev_team.log> to the RKNN Toolkit development team.
    E You can also check github issues: https://github.com/rockchip-linux/rknn-toolkit/issues
    E Export precompile RKNN model failed!
  5. _01 _04 _05 _07 Model Pre-compiling Warning:

    root@7a64f1381911:/thonnn/rktools# python3 export_rknn_precompile_model.py Gundam_RV1109/_04_rnet Gundam_RV1109_Output/_04_rnet                                
    Use default target: rv1126
    W rknn-toolkit version: 1.7.5
    --> Loading RKNN model
    done
    --> Init runtime environment
    I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:36)
    D RKNNAPI: ==============================================
    D RKNNAPI: RKNN VERSION:
    D RKNNAPI:   API: 1.7.5 (bb79b30 build: 2023-06-20 09:54:19)
    D RKNNAPI:   DRV: 1.7.5 (bb79b30 build: 2023-07-18 10:56:54)
    D RKNNAPI: ==============================================
    done
    W RKNNAPI: IOCTL_CMD_RKNN_PRECOMPILE fail, ack=0, data_len=0!
    W RKNNAPI: IOCTL_CMD_RKNN_PRECOMPILE fail, ack=0, data_len=0!
  6. Pre-compiling Environment:

    • Windows 11 host with Ubuntu 22.04 VM running on VMWare 17.
    • RV1126 USB ADB connected.
    • Using rknn-toolkit-1.7.5 docker image from the RKNPU website.
    • RV1126 with the latest full driver update.
    • Pre-compile script: export_rknn_precompile_model.py from the rknn-toolkit github example.
  7. My Requests:

    • Could you please provide the pre-compiled model files you used for testing?
    • Alternatively, I saw that the project’s Benchmark Remark includes RV1126 test results. Could you provide some guidance on how you tested on the RV1126?

Thank you for your assistance.

tunmx commented 5 months ago

Hello,

We have also encountered some troublesome issues with the pre-compiled model, and we are currently addressing them. You only need to enable the CMake option ISF_ENABLE_BENCHMARK during compilation to test the benchmark in the test program.

Thonnn commented 4 months ago

Thank you, and I look forward to your prompt resolution of this issue. In the meantime, I will try the benchmark.