|
板凳
楼主 |
发表于 2020-2-6 17:50:25
|
只看该作者
from rknn.api import RKNN
INPUT_SIZE = 300
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN()
# Config for Model Input PreProcess
rknn.config(channel_mean_value='128 128 128 128', reorder_channel='0 1 2')
# Load TensorFlow Model
print('--> Loading model')
rknn.load_tensorflow(tf_pb='./frozen_inference_graph.pb',
inputs=['FeatureExtractor/MobilenetV2/MobilenetV2/input'],
#inputs=['image_tensor'],
outputs=['concat', 'concat_1'],
input_size_list=[[INPUT_SIZE, INPUT_SIZE, 3]])
print('done')
# Build Model
print('--> Building model')
rknn.build(do_quantization=True, dataset='./dataset.txt')
print('done')
# Export RKNN Model
rknn.export_rknn('./ssd_mobilenet_v2_coco.rknn')
# Release RKNN Context
rknn.release()
我转的是ssd-mobilenetV2 的模型,模型输入输出用tensorborad 看过应该没啥问题
|
|