Toybrick

标题: Android Demo rknn_query fail [打印本页]

作者: astree    时间: 2019-5-27 11:10
标题: Android Demo rknn_query fail
本帖最后由 astree 于 2019-5-27 11:11 编辑

Android实例替换掉自己的模型出现如下报错。模型是通过官方的script导出,toolkit也是1.0版本的,模型在模拟器,板子的fedora系统和ADB python runtime测试都是正常运行和推理正确的,在安卓能够正常加载但是查询却出错,不能正常推理。请问有人遇到这样的问题吗,谢谢?相关信息如下:

outputs_attr[1].index = output_index1;
ret = rknn_query(ctx, RKNN_QUERY_OUTPUT_ATTR, &(outputs_attr[1]), sizeof(outputs_attr[1]));
if(ret < 0) {
    LOGI("rknn_query fail ! ret=%d\n", ret);
    return;
}

测试是执行上面的API出现错误,日志信息如下
[size=13.3333px]com.rockchip.gpadc.ssddemo D/RKNNAPI: ==============================================

[size=13.3333px]com.rockchip.gpadc.ssddemo D/RKNNAPI: RKNN VERSION:
[size=13.3333px]com.rockchip.gpadc.ssddemo D/RKNNAPI:   API: 0.9.5 (a949908 build: 2019-05-07 22:20:52)
[size=13.3333px]com.rockchip.gpadc.ssddemo D/RKNNAPI:   DRV: 0.9.6 (c12de8a build: 2019-05-06 20:10:17)
[size=13.3333px]com.rockchip.gpadc.ssddemo D/RKNNAPI: ==============================================
[size=13.3333px]com.rockchip.gpadc.ssddemo E/RKNNAPI: rknn_query,  RKNN_QUERY_OUTPUT_ATTR, info->index = 1, expect 1!
[size=13.3333px]com.rockchip.gpadc.ssddemo I/rkssd4j: rknn_query fail 4! ret=-5


作者: astree    时间: 2019-5-27 16:41
已解决,tensor 的size问题要配合自己的模型
作者: keji    时间: 2020-2-18 12:01
how to fix it ? By change sizeof(outputs_attr[1]) to what it want me ,? but it still not working;
D RKNNAPI: ==============================================
D RKNNAPI: RKNN VERSION:
D RKNNAPI:   API: 1.3.0 (c5654ea build: 2019-12-25 14:12:00)
D RKNNAPI:   DRV: 0.9.9 (8509ec7 build: 2019-08-05 10:54:34)
D RKNNAPI: ==============================================
ret = 0
E RKNNAPI: rknn_query,  RKNN_QUERY_OUTPUT_ATTR, size = 368, expect 360!
rknn_query1 fail! ret=-5





欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3