Toybrick

标题: 关于tensorflow版本的yolo转rknn模型问题 [打印本页]

作者: KirutoCode    时间: 2019-9-29 20:36
标题: 关于tensorflow版本的yolo转rknn模型问题
使用的代码如下:https://github.com/ultralytics/yolov3
转rknn的代码如下

  1.     # Create RKNN object
  2.     rknn = RKNN()

  3.     # Load tensorflow model
  4.     print('--> Loading model')
  5.     a = rknn.load_tensorflow(tf_pb='yolov3_coco.pb',inputs=['conv0'],outputs=['conv_lbbox','conv_mbbox','conv_sbbox'],input_size_list=[[416,416,3]])
  6.     print('return is ',a)
  7.     print('done')

  8.     rknn.config(channel_mean_value='0 0 0 255', reorder_channel='0 1 2', batch_size=1)

  9.     # Build model
  10.     print('--> Building model')
  11.     rknn.build(do_quantization=False, pre_compile=False)
  12.     print('done')
复制代码
报错如下
  1. return is  -1
  2. done
  3. --> Building model
  4. Traceback (most recent call last):
  5.   File "rknn_transform_onnx_416x416.py", line 27, in <module>
  6.     rknn.build(do_quantization=False, pre_compile=False)
  7.   File "/home/dad/anaconda3/envs/market/lib/python3.6/site-packages/rknn/api/rknn.py", line 163, in build
  8.     inputs = self.rknn_base.net.get_input_layers()
  9. AttributeError: 'NoneType' object has no attribute 'get_input_layers'
复制代码
请问是哪里写的不对吗,tensorflow的pb加载失败了。








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