Toybrick

TB-RK3399ProX Android8.1用rk_ssd_demo这个demo跑自己的模型时总是...

fu-ai

新手上路

积分
45
楼主
发表于 2021-5-25 15:21:26    查看: 47109|回复: 20 | [复制链接]    打印 | 只看该作者
本帖最后由 fu-ai 于 2021-5-25 15:39 编辑

转换模型时的log信息如下  ↓ ↓ ↓

--> Config model
done
--> Loading model
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/rknn/api/rknn.py:75: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.graph_util.extract_sub_graph`
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
W Network may not support batch > 1 !
/home/toybrick/.local/lib/python3.7/site-packages/rknn/api/rknn.py:75: FutureWarning: Possible nested set at position 7
  std_values=std_values, size_with_batch=size_with_batch)
done
--> Building model
W The target_platform is not set in config, using default target platform rk1808.
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/tensorflow_core/python/framework/func_graph.py:915: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.
   
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
done
--> Export RKNN model
done
--> Init runtime environment
I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:51)
D RKNNAPI: ==============================================
D RKNNAPI: RKNN VERSION:
D RKNNAPI:   API: 1.6.0 (79320de build: 2020-12-29 10:57:09)
D RKNNAPI:   DRV: 1.6.0 (159d2d3 build: 2021-01-12 15:23:09)
D RKNNAPI: ==============================================
done
--> Running model
D RKNNAPI: __can_use_fixed_point: use_fixed_point = 1.

done
--> Evaluate model performance
W When performing performance evaluation, inputs can be set to None to use fake inputs.
========================================================================
                               Performance                              
========================================================================
Total Time(us): 11979
FPS: 83.48
========================================================================

done





Android Studio 的 log信息如下  ↓ ↓ ↓


2021-01-06 13:06:23.981 2405-2405/? I/zygote64: Late-enabling -Xcheck:jni
2021-01-06 13:06:24.352 2405-2405/com.rockchip.gpadc.ssddemo D/ssd: Create /data/user/0/com.rockchip.gpadc.ssddemo/cache/ssd.rknn
2021-01-06 13:06:24.466 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Do partial code cache collection, code=29KB, data=20KB
2021-01-06 13:06:24.466 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: After code cache collection, code=20KB, data=17KB
2021-01-06 13:06:24.466 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Increasing code cache capacity to 128KB
2021-01-06 13:06:24.498 2405-2405/com.rockchip.gpadc.ssddemo D/ssd: Loaded box priors!
2021-01-06 13:06:24.499 2405-2405/com.rockchip.gpadc.ssddemo D/ssd: Loaded label!
2021-01-06 13:06:24.606 2405-2405/com.rockchip.gpadc.ssddemo V/ssd: Camera Supported Preview Size = 1280x720
2021-01-06 13:06:24.606 2405-2405/com.rockchip.gpadc.ssddemo V/ssd: Camera Supported Preview Size = 640x480
2021-01-06 13:06:24.623 2405-2444/com.rockchip.gpadc.ssddemo D/OpenGLRenderer: HWUI GL Pipeline
2021-01-06 13:06:24.660 2405-2444/com.rockchip.gpadc.ssddemo I/mali_so: [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 947; [Func] : base_context_deal_with_version_affairs_rk_ext;
    arm_release_ver of this mali_so is 'r18p0-01rel0', rk_so_ver is '11@0'.
2021-01-06 13:06:24.660 2405-2444/com.rockchip.gpadc.ssddemo I/mali_so: [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 914; [Func] : determine_policy_against_patch_for_sf_memory_leak;
    cmdline : com.rockchip.gpadc.ssddemo, we should GO THROUGH patch_for_sf_memory_leak.
2021-01-06 13:06:24.660 2405-2444/com.rockchip.gpadc.ssddemo D/mali_so: [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 955; [Func] : base_context_deal_with_version_affairs_rk_ext;
    current process is NOT sf, to bail out.
2021-01-06 13:06:24.672 2405-2444/com.rockchip.gpadc.ssddemo I/com.rockchip.gpadc.ssddemo: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2021-01-06 13:06:24.672 2405-2444/com.rockchip.gpadc.ssddemo I/OpenGLRenderer: Initialized EGL, version 1.4
2021-01-06 13:06:24.672 2405-2444/com.rockchip.gpadc.ssddemo D/OpenGLRenderer: Swap behavior 2
2021-01-06 13:06:24.679 2405-2444/com.rockchip.gpadc.ssddemo D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2021-01-06 13:06:24.696 2405-2430/com.rockchip.gpadc.ssddemo D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2021-01-06 13:06:24.802 2405-2458/com.rockchip.gpadc.ssddemo I/rkssd4j: try rknn_init!
2021-01-06 13:06:24.823 2405-2405/com.rockchip.gpadc.ssddemo I/Thread-3: type=1400 audit(0.0:120): avc: denied { write } for name="transfer_proxy" dev="tmpfs" ino=9963 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=ubject_r:socket_device:s0 tclass=sock_file permissive=1
2021-01-06 13:06:24.823 2405-2405/com.rockchip.gpadc.ssddemo I/Thread-3: type=1400 audit(0.0:121): avc: denied { connectto } for path="/dev/socket/transfer_proxy" scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:npu_transfer_proxy:s0 tclass=unix_stream_socket permissive=1
2021-01-06 13:06:27.723 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Do partial code cache collection, code=49KB, data=55KB
2021-01-06 13:06:27.724 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: After code cache collection, code=43KB, data=53KB
2021-01-06 13:06:27.724 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Increasing code cache capacity to 256KB
2021-01-06 13:06:27.724 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Compiler allocated 6MB to compile void android.view.ViewRootImpl.performTraversals()
2021-01-06 13:06:33.444 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Do full code cache collection, code=124KB, data=90KB
2021-01-06 13:06:33.445 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: After code cache collection, code=94KB, data=63KB
2021-01-06 13:06:35.605 2405-2458/com.rockchip.gpadc.ssddemo D/RKNNAPI: ==============================================
2021-01-06 13:06:35.605 2405-2458/com.rockchip.gpadc.ssddemo D/RKNNAPI: RKNN VERSION:
2021-01-06 13:06:35.605 2405-2458/com.rockchip.gpadc.ssddemo D/RKNNAPI:   API: 1.6.0 (159d2d3 build: 2021-01-22 11:15:48)
2021-01-06 13:06:35.605 2405-2458/com.rockchip.gpadc.ssddemo D/RKNNAPI:   DRV: 1.5.0 (83d70a9 build: 2020-09-30 16:25:49)
2021-01-06 13:06:35.605 2405-2458/com.rockchip.gpadc.ssddemo D/RKNNAPI: ==============================================
2021-01-06 13:06:35.612 2405-2458/com.rockchip.gpadc.ssddemo I/rkssd4j: rknn_init success!
2021-01-06 13:06:35.614 2405-2458/com.rockchip.gpadc.ssddemo D/RKNNAPI: __can_use_fixed_point: use_fixed_point = 1.
2021-01-06 13:06:35.617 2405-2458/com.rockchip.gpadc.ssddemo E/RKNNAPI: rknn_outputs_get,  outputs[0].size = 15336! expect 30672!
2021-01-06 13:06:35.617 2405-2458/com.rockchip.gpadc.ssddemo E/rkssd4j: rknn_outputs_get fail! ret=-5
2021-01-06 13:06:35.621 2405-2458/com.rockchip.gpadc.ssddemo E/RKNNAPI: rknn_outputs_get,  outputs[0].size = 15336! expect 30672!
2021-01-06 13:06:35.622 2405-2458/com.rockchip.gpadc.ssddemo E/rkssd4j: rknn_outputs_get fail! ret=-5
2021-01-06 13:06:35.630 2405-2458/com.rockchip.gpadc.ssddemo E/RKNNAPI: rknn_outputs_get,  outputs[0].size = 15336! expect 30672!
2021-01-06 13:06:35.630 2405-2458/com.rockchip.gpadc.ssddemo E/rkssd4j: rknn_outputs_get fail! ret=-5
2021-01-06 13:06:35.648 2405-2405/com.rockchip.gpadc.ssddemo D/ssd: something may wrong! validCount=1917
2021-01-06 13:06:35.661 2405-2405/com.rockchip.gpadc.ssddemo D/ssd: something may wrong! validCount=1917
2021-01-06 13:06:35.663 2405-2458/com.rockchip.gpadc.ssddemo W/RKNNAPI: rknn_run,  is about to block until rknn_outputs_get is called!
2021-01-06 13:06:40.776 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Do partial code cache collection, code=124KB, data=83KB
2021-01-06 13:06:40.777 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: After code cache collection, code=120KB, data=81KB
2021-01-06 13:06:40.777 2405-2410/com.rockchip.gpadc.ssddemo I/zygote64: Increasing code cache capacity to 512KB
2021-01-06 13:06:54.158 2405-2405/com.rockchip.gpadc.ssddemo I/ssd: stopped camera

请问大佬,这个问题怎么解决??
推理图如图


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

jefferyzhang

版主

积分
13578
沙发
发表于 2021-5-25 16:16:32 | 只看该作者
如果只是DRV差异那就简单了,直接升级下Android的rknn的driver即可
回复

使用道具 举报

fu-ai

新手上路

积分
45
板凳
 楼主| 发表于 2021-5-25 16:18:36 | 只看该作者
不是,我也跑了一下你们的rk_ssd_demo,只是模型不同
回复

使用道具 举报

fu-ai

新手上路

积分
45
地板
 楼主| 发表于 2021-5-25 16:23:40 | 只看该作者
我跑你们的rk_ssd_demo,用你们的模型可以显示检测框和fps,但是换成我自己的模型、coco_labels_list.txt 和 box_priors.txt 后虽然可以打开app,但是fps显示0和无检测框。
回复

使用道具 举报

395876134

版主

积分
1099
5#
发表于 2021-5-25 16:23:57 | 只看该作者
回复

使用道具 举报

fu-ai

新手上路

积分
45
6#
 楼主| 发表于 2021-5-25 16:27:22 | 只看该作者
照理说如果是DRV差异,那么你们官方的模型应该也不会出现检测框??还是说我这边把 模型、coco_labels_list.txt 和 box_priors.txt这三个东西发给你那边看看??
回复

使用道具 举报

jefferyzhang

版主

积分
13578
7#
发表于 2021-5-25 16:31:45 | 只看该作者
fu-ai 发表于 2021-5-25 16:27
照理说如果是DRV差异,那么你们官方的模型应该也不会出现检测框??还是说我这边把 模型、coco_labels_list ...

转换模型用的rknntoolkit版本必须和drv是匹配的。我们的模型并不一定是1.6 rknntoolkit转换的。不用纠结这个。
你只要确定你的模型linux下1.6可用,android下1.5不可用,那就是drv版本问题了
回复

使用道具 举报

fu-ai

新手上路

积分
45
8#
 楼主| 发表于 2021-5-25 16:34:30 | 只看该作者
如果照你这么说,那就是drv的问题了,那我该怎么操作,在Debian10还是Android上?
回复

使用道具 举报

jefferyzhang

版主

积分
13578
9#
发表于 2021-5-25 16:42:55 | 只看该作者
fu-ai 发表于 2021-5-25 16:34
如果照你这么说,那就是drv的问题了,那我该怎么操作,在Debian10还是Android上? ...

http://t.rock-chips.com/forum.ph ... &extra=page%3D1

直接在android上更新一把试试
回复

使用道具 举报

fu-ai

新手上路

积分
45
10#
 楼主| 发表于 2021-5-25 16:45:23 | 只看该作者
我没弄过Android底层,不知道这个怎么操作     adb root && adb remount && adb push npu_fw /vendor/etc/ && adb reboot  ,请大佬点拨点拨
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表