Toybrick

楼主: jefferyzhang

rknn-toolkit & rknn-api for Toybrick

 

cdzs_3411

中级会员

积分
419
161#
发表于 2020-5-11 13:36:47 | 只看该作者
请问下,要在 3399 上以被动模式使用 rk1808, 只用 rknn-api(C代码)的话,除了要执行“sudo ./update_rk1808_ai_cs_rule.sh”外, 还得再装 rknn-toolkit 么?
回复

使用道具 举报

hhhjjjwww

中级会员

积分
231
162#
发表于 2020-6-3 16:59:25 | 只看该作者
我下载了https://github.com/rockchip-linux/rknn-toolkit 1.32版本,在rk3399pro运行报错了:
toybrick@debian10:~/code/examples/tensorflow/ssd_mobilenet_v1$ python ssd.py
--> Loading model
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/ceil.py:10: The name tf.ceil is deprecated. Please use tf.math.ceil instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/depth_to_space.py:12: The name tf.depth_to_space is deprecated. Please use tf.compat.v1.depth_to_space instead.

W:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/co ... 7-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/log.py:10: The name tf.log is deprecated. Please use tf.math.log instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/random_normal.py:9: The name tf.random_normal is deprecated. Please use tf.random.normal instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/random_uniform.py:9: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/upsample.py:13: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.

/home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/common/__init__.py:87: UserWarning: FrontendHandler.get_outputs_names is deprecated. It will be removed in future release.. Use node.outputs instead.
  warnings.warn(message)
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/rknn/api/rknn.py:67: 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`
E Catch exception when loading tensorflow model: ./ssd_mobilenet_v1_coco_2017_11_17.pb!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 215, in rknn.api.rknn_base.RKNNBase.load_tensorflow
E   File "rknn/base/RKNNlib/converter/convert_tf.py", line 527, in rknn.base.RKNNlib.converter.convert_tf.convert_tf.pre_process
E   File "rknn/base/RKNNlib/converter/tensorflowloader.py", line 96, in rknn.base.RKNNlib.converter.tensorflowloader.TF_Graph_Preprocess.pre_proces
E   File "rknn/base/RKNNlib/converter/tensorflowloader.py", line 555, in rknn.base.RKNNlib.converter.tensorflowloader.TF_Graph_Preprocess.import_tf_ruler_module
E   File "/home/toybrick/.local/lib/python3.7/site-packages/rknn/base/RKNNlib/converter/tfruler/__init__.py", line 2, in <module>
E     from .tf_ruler_generate import r_add_n_template, r_concatv2_template, r_split_template
E ImportError: cannot import name 'r_add_n_template' from 'tfruler.tf_ruler_generate' (/home/toybrick/.local/lib/python3.7/site-packages/rknn/base/RKNNlib/converter/tfruler/tf_ruler_generate.cpython-37m-aarch64-linux-gnu.so)
done
--> Building model
Traceback (most recent call last):
  File "ssd.py", line 75, in <module>
    rknn.build(do_quantization=True, dataset='./dataset.txt')
  File "/home/toybrick/.local/lib/python3.7/site-packages/rknn/api/rknn.py", line 222, in build
    inputs = self.rknn_base.net.get_input_layers()
AttributeError: 'NoneType' object has no attribute 'get_input_layers'

我安装了rknn,tensorflow版本是1.14,系统是debian10
回复

使用道具 举报

hhhjjjwww

中级会员

积分
231
163#
发表于 2020-6-4 09:34:02 | 只看该作者
执行sudo apt install rknn-rk3399pro这个按照命令后出现以下报错:
dpkg: dependency problems prevent configuration of libgnome-desktop-3-17:arm64:
gnome-desktop3-data (3.36.2-1) breaks libgnome-desktop-3-17 (<< 3.36) and is installed.
  Version of libgnome-desktop-3-17:arm64 to be configured is 3.30.2.1-2.

dpkg: error processing package libgnome-desktop-3-17:arm64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libgnome-desktop-3-17:arm64
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
请问怎么解决??求帮忙
回复

使用道具 举报

jefferyzhang

版主

积分
13572
164#
 楼主| 发表于 2020-6-4 11:02:11 | 只看该作者
hhhjjjwww 发表于 2020-6-4 09:34
执行sudo apt install rknn-rk3399pro这个按照命令后出现以下报错:
dpkg: dependency problems prevent co ...

这命令是我们Toybrick开发版上的,你这是什么板子
回复

使用道具 举报

hhhjjjwww

中级会员

积分
231
165#
发表于 2020-6-4 13:37:27 | 只看该作者
jefferyzhang 发表于 2020-6-4 11:02
这命令是我们Toybrick开发版上的,你这是什么板子

TB-RK3399ProD,在你们给的官方渠道买的
回复

使用道具 举报

jefferyzhang

版主

积分
13572
166#
 楼主| 发表于 2020-6-4 13:55:15 | 只看该作者
hhhjjjwww 发表于 2020-6-4 13:37
TB-RK3399ProD,在你们给的官方渠道买的

跑的是什么系统
回复

使用道具 举报

hhhjjjwww

中级会员

积分
231
167#
发表于 2020-6-4 14:08:13 | 只看该作者

是debian10
回复

使用道具 举报

hhhjjjwww

中级会员

积分
231
168#
发表于 2020-6-4 14:21:58 | 只看该作者

对了,我还想请教一下,我在PC用tensorflow训练的模型(faster-rcnn+vgg16,yolov3+darknet),如果要转换到rknn模型,是不是首先要转换到tensorflow的.pb模型,然后在PC上用rknn转.rknn模型,然后再PC上推理验证正确了,再拿到TB-RK3399ProD上面用?
回复

使用道具 举报

jefferyzhang

版主

积分
13572
169#
 楼主| 发表于 2020-6-4 14:45:37 | 只看该作者

我们自测没问题,你是改过系统什么东西么?我们本来系统就自带且装好了,按置顶帖直接升级就可以到最新版本了
回复

使用道具 举报

jefferyzhang

版主

积分
13572
170#
 楼主| 发表于 2020-6-4 14:46:15 | 只看该作者
hhhjjjwww 发表于 2020-6-4 14:21
对了,我还想请教一下,我在PC用tensorflow训练的模型(faster-rcnn+vgg16,yolov3+darknet),如果要转 ...

这个问题建议你通读一边文档再说。嵌入式NPU没你想的这么简单,需要很多时间去调试
回复

使用道具 举报

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

本版积分规则

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


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