RKNN "rknn_init fail! ret=-6" RKNN_ERR_MODEL_INVALID: Fix

rknn_init fail! ret=-6 (RKNN_ERR_MODEL_INVALID)

The RKNN runtime rejected the .rknn file. Usually the model was converted with a toolkit version the board's librknnrt does not support, or for a different target platform.

Applies to: RK3588 RK3588S RK3576 RK3568 RK3566 RK3562 RV1106 RV1103

Symptoms

  • rknn_init() returns -6 in C, or init_runtime fails in RKNN-Toolkit-Lite2
  • The same model works on another board or image

Common causes

  • RKNN-Toolkit2 version newer than the librknnrt.so on the board
  • Model exported for a different target_platform (e.g. rk3568 model on rk3588)
  • Truncated or corrupted .rknn file (git-lfs pointer, partial copy)

How to fix it

  1. Compare versions
    strings /usr/lib/librknnrt.so | grep -i 'librknnrt version'
    pip show rknn-toolkit2   # on the conversion host
  2. Align runtime and toolkit

    Either update librknnrt.so (and the NPU driver if required) on the board to match the toolkit, or convert again with the toolkit version matching the board runtime.

  3. Re-export for the right platform
    rknn.config(target_platform='rk3588')   # match the board SoC

Go deeper

FAQ

What does "rknn_init fail! ret=-6 (RKNN_ERR_MODEL_INVALID)" mean?

The RKNN runtime rejected the .rknn file. Usually the model was converted with a toolkit version the board's librknnrt does not support, or for a different target platform.

What causes "rknn_init fail! ret=-6 (RKNN_ERR_MODEL_INVALID)"?

RKNN-Toolkit2 version newer than the librknnrt.so on the board; Model exported for a different target_platform (e.g. rk3568 model on rk3588); Truncated or corrupted .rknn file (git-lfs pointer, partial copy).

How do I fix "rknn_init fail! ret=-6 (RKNN_ERR_MODEL_INVALID)"?

1. Compare versions 2. Align runtime and toolkit: Either update librknnrt.so (and the NPU driver if required) on the board to match the toolkit, or convert again with the toolkit version matching the board runtime. 3. Re-export for the right platform

Related issues

Rockchip 기반 제품을 개발 중이신가요?

하드웨어 설계부터 Linux, Android, AI 통합까지 Rockchip 프로젝트를 위한 엔지니어링 지원을 받으세요.