|
各位好,
如何把mars-small128.pb转为rknn;有没有写好的.py文件;我改了一个,运行的时候总是报错;
使用mars-small128.pb没有用RK3399pro的npu,跟踪起来很卡,想把npu用起来;
from PIL import Image
import numpy as np
#from matplotlib import pyplot as plt
import re
import math
import random
from rknn.api import RKNN
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN()
# Load tensorflow model
print('--> Loading model')
rknn.load_tensorflow(tf_pb='mars-small128.pb',inputs=['image','boxes'],outputs=['features'],input_size_list=[[416, 416, 3]])
print('done')
rknn.config(channel_mean_value='0 0 0 255', reorder_channel='0 1 2')
# Build model
print('--> Building model')
rknn.build(do_quantization=False,pre_compile=False)
print('done')
rknn.export_rknn('./mars-small128.rknn')
exit(0)
~
报错信息如下
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/zg/.local/lib/python3.5/site-packages/onnx_tf/handlers/backend/is_nan.py:9: The name tf.is_nan is deprecated. Please use tf.math.is_nan instead.
W:tensorflow:From /home/zg/.local/lib/python3.5/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/zg/.local/lib/python3.5/site-packages/onnx_tf/handlers/backend/upsample.py:13: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.
/home/zg/.local/lib/python3.5/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)
--> Loading model
E length of input_size_list is not equal to inputs
E Catch exception when loading tensorflow model: mars-small128.pb!
T Traceback (most recent call last):
T File "rknn/api/rknn_base.py", line 135, in rknn.api.rknn_base.RKNNBase.load_tensorflow
T File "rknn/base/RKNNlib/converter/convert_tf.py", line 89, in rknn.base.RKNNlib.converter.convert_tf.convert_tf.__init__
T File "/home/zg/.local/lib/python3.5/site-packages/rknn/base/RKNNlib/RKNNlog.py", line 267, in e
T raise ValueError(msg)
T ValueError: length of input_size_list is not equal to inputs
done
--> Building model
Traceback (most recent call last):
File "rknn_transform_mars128.py", line 27, in <module>
rknn.build(do_quantization=False,pre_compile=False)
File "/home/zg/.local/lib/python3.5/site-packages/rknn/api/rknn.py", line 163, in build
inputs = self.rknn_base.net.get_input_layers()
AttributeError: 'NoneType' object has no attribute 'get_input_layers'
|
|