|
转换其他模型没问题,已经转过很多其他模型.这次就出现问题了.
环境: ubuntu16.04 , rknn0.99 ,代码如下, 转的是faceNet 的模型.
from rknn.api import RKNN
INPUT_SIZE = 224
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN()
# Config for Model Input PreProcess
rknn.config(channel_mean_value='127.5 127.5 127.5 127.5', reorder_channel='0 1 2' ,quantized_dtype = 'asymmetric_quantized-u8')
# Load TensorFlow Model
print('--> Loading model')
out = 'InceptionResnetV1/Bottleneck/BatchNorm/batchnorm/add_1'
rknn.load_tensorflow(tf_pb='20170512-110547.pb',
inputs=['input_1', 'phase_train'],
outputs=[out],
input_size_list=[[INPUT_SIZE, INPUT_SIZE, 3] , [1] ])
print('done')
# Build Model
print('--> Building model')
rknn.build(do_quantization=True, dataset='./dataset.txt')
print('done')
# Export RKNN Model
rknn.export_rknn('./exmaple.rknn')
print("rknn convert sucess! ")
出错信息:
--> Loading model
E Catch exception when loading tensorflow model: 20170512-110547.pb!
T Traceback (most recent call last):
T File "rknn/api/rknn_base.py", line 132, in rknn.api.rknn_base.RKNNBase.load_tensorflow
T File "rknn/base/RKNNlib/converter/convert_tf.py", line 95, in rknn.base.RKNNlib.converter.convert_tf.convert_tf.__init__
T File "rknn/base/RKNNlib/converter/tensorflowloader.py", line 53, in rknn.base.RKNNlib.converter.tensorflowloader.TF_Graph_Preprocess.__init__
T AttributeError: 'NoneType' object has no attribute 'op'
done
--> Building model
E Catch exception when building RKNN model!
T Traceback (most recent call last):
T File "rknn/api/rknn_base.py", line 459, in rknn.api.rknn_base.RKNNBase.build
T File "rknn/api/rknn_base.py", line 939, in rknn.api.rknn_base.RKNNBase._quantize
T File "rknn/base/RKNNlib/console/utils.py", line 7, in rknn.base.RKNNlib.console.utils.get_model_data_file
T File "/usr/lib/python3.5/posixpath.py", line 122, in splitext
T return genericpath._splitext(p, sep, None, extsep)
T File "/usr/lib/python3.5/genericpath.py", line 118, in _splitext
T sepIndex = p.rfind(sep)
T AttributeError: 'NoneType' object has no attribute 'rfind'
done
|
|