Toybrick
标题:
请问如何把darknet模型转换成rknn?
[打印本页]
作者:
15992605143
时间:
2019-10-21 21:36
标题:
请问如何把darknet模型转换成rknn?
请问如何把darknet模型转换成rknn?
作者:
jefferyzhang
时间:
2019-10-22 08:38
rknn.load_darknet
详细请参看文档。
作者:
Cat
时间:
2019-10-22 09:38
我在QuickStart里面没看到.load_darknet
只看到tf和caffe,还有一个模型tiff啥的不认识
作者:
Cat
时间:
2019-10-22 09:44
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文件的调用,哪里有详细介绍文档?
欢迎光临 Toybrick (https://t.rock-chips.com/)
Powered by Discuz! X3.3