|
rknn_convert.py里面弄是吗?
print('--> Loading model...')
if model['platform'] == 'tensorflow':
model_file_path = os.path.join(model_path, model['model_file_path'])
input_size_list = []
for input_size_str in model['subgraphs']['input-size-list']:
input_size = list(map(int, input_size_str.split(',')))
input_size_list.append(input_size)
pass
rknn.load_tensorflow(tf_pb=model_file_path,
inputs=model['subgraphs']['inputs'],
outputs=model['subgraphs']['outputs'],
input_size_list=input_size_list)
elif model['platform'] == 'tflite':
model_file_path = os.path.join(model_path, model['model_file_path'])
rknn.load_tflite(model=model_file_path)
elif model['platform'] == 'caffe':
prototxt_file_path = os.path.join(model_path,model['prototxt_file_path'])
caffemodel_file_path = os.path.join(model_path,model['caffemodel_file_path'])
rknn.load_caffe(model=prototxt_file_path, proto='caffe', blobs=caffemodel_file_path)
elif model['platform'] == 'onnx':
model_file_path = os.path.join(model_path, model['model_file_path'])
rknn.load_onnx(model=model_file_path)
else:
print("platform %s not support!" % (model['platform']))
print('done')
if model['quantize']:
dataset_path = os.path.join(model_path, model['dataset'])
else:
dataset_path = './dataset'
print('--> Build RKNN model...')
rknn.build(do_quantization=model['quantize'], dataset=dataset_path, pre_compile=pre_compile)
print('done')
export_rknn_model_path = "%s.rknn" % (os.path.join(out_path, model_name))
print('--> Export RKNN model to: {}'.format(export_rknn_model_path))
rknn.export_rknn(export_path=export_rknn_model_path)
exported_rknn_model_path_list.append(export_rknn_model_path)
print('done')
就是一般模型都分成模型结构和模型权值两块,比如
caffe里面是.prototxt和.weight文件
darknet里面是.cfg和。weights文件
rknn_convert.py例子里面并没有看到加载darknet模型.cfg和.weights文件的调用,哪里有详细介绍文档? |
|