Toybrick

楼主: jefferyzhang

rknn-toolkit & rknn-api for Toybrick

 

christian

注册会员

积分
132
楼主
发表于 2020-3-22 23:38:14 | 显示全部楼层
debian10,运行ssd_mobilenet_v1出现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
log如下:
toybrick@debian10:~/Work/examples/tensorflow/ssd_mobilenet_v1$ python3 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:65: 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`
2020-03-22 15:32:04.823909: W tensorflow/core/framework/allocator.cc:107] Allocation of 1080000 exceeds 10% of system memory.
2020-03-22 15:32:04.843025: W tensorflow/core/framework/allocator.cc:107] Allocation of 1080000 exceeds 10% of system memory.
2020-03-22 15:32:04.971756: W tensorflow/core/framework/allocator.cc:107] Allocation of 1048576 exceeds 10% of system memory.
2020-03-22 15:32:04.972672: W tensorflow/core/framework/allocator.cc:107] Allocation of 1048576 exceeds 10% of system memory.
2020-03-22 15:32:04.973630: W tensorflow/core/framework/allocator.cc:107] Allocation of 1048576 exceeds 10% of system memory.
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 189, 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 220, in build
    inputs = self.rknn_base.net.get_input_layers()
AttributeError: 'NoneType' object has no attribute 'get_input_layers'
回复

使用道具 举报

christian

注册会员

积分
132
沙发
发表于 2020-3-23 11:32:23 | 显示全部楼层
jefferyzhang 发表于 2020-3-23 08:52
在pc上试下,py3.6 + tf1.13 + rknntoolkit1.3

在PC上是可以得,PC上使用tf1.13转化模型,在板子上使用tf1.14可以跑的吗?昨天PC转出来,在板子上试了下tf1.14报错
回复

使用道具 举报

christian

注册会员

积分
132
板凳
发表于 2020-3-23 11:41:51 | 显示全部楼层
jefferyzhang 发表于 2020-3-23 11:36
跑rknn跟tensorflow版本无关吧?

我晚上回去在试下看。PC转出来的rknn理论上是不依赖tf的版本的吧,所以只要PC和板子的rknntoolkit保持一致,板子和PC机的rknn模型就是可以通用的,是这个意思不?
回复

使用道具 举报

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

本版积分规则

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


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