RKNN_ERR_TARGET_PLATFORM_UNMATCH (-13): Model Built for Another SoC

RKNN_ERR_TARGET_PLATFORM_UNMATCH (-13)

The .rknn model was compiled for a different NPU than the one it is running on. RKNN models are not portable across SoC families.

Applies to: RK3588 RK3588S RK3576 RK3568 RK3566 RK3562 RV1106 RV1103

Symptoms

  • rknn_init returns -13
  • Model converted on a PC "works" in simulation but not on the board

Common causes

  • target_platform in rknn.config() does not match the board (rk3588 / rk3576 / rk3568 / rk3566 / rv1106 …)
  • Using a model from a demo repo built for another board

How to fix it

  1. Check which SoC you are on
    cat /proc/device-tree/compatible | tr '\0' '\n' | tail -1
  2. Rebuild for that platform
    rknn.config(mean_values=[[0,0,0]], std_values=[[255,255,255]], target_platform='rk3576')
    rknn.load_onnx(model='model.onnx')
    rknn.build(do_quantization=True, dataset='./dataset.txt')
    rknn.export_rknn('model_rk3576.rknn')

Go deeper

FAQ

What does "RKNN_ERR_TARGET_PLATFORM_UNMATCH (-13)" mean?

The .rknn model was compiled for a different NPU than the one it is running on. RKNN models are not portable across SoC families.

What causes "RKNN_ERR_TARGET_PLATFORM_UNMATCH (-13)"?

target_platform in rknn.config() does not match the board (rk3588 / rk3576 / rk3568 / rk3566 / rv1106 …); Using a model from a demo repo built for another board.

How do I fix "RKNN_ERR_TARGET_PLATFORM_UNMATCH (-13)"?

1. Check which SoC you are on 2. Rebuild for that platform

Related issues

Building a Rockchip-based product?

From hardware design to Linux, Android and AI integration, get engineering support for your Rockchip project.