|
from rknn.api import RKNN
INPUT_SIZE = 160
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN(verbose=False, verbose_file='./test1.log')
# Config for Model Input PreProcess
rknn.config(channel_mean_value='0 0 0 1', reorder_channel='0 1 2',target_platform=['rv1126'])
print('config done')
# load tensorflow model
print('--> Loading model')
rknn.load_tensorflow(tf_pb='./pretrainedmodel/20180402-114759/20180402-114759.pb',
# inputs=['input', 'phase_train'],
inputs=['input'],
outputs=['InceptionResnetV1/Bottleneck/BatchNorm/Reshape_1'],
input_size_list=[[INPUT_SIZE, INPUT_SIZE, 3]])
print('done')
# Build Model
print('--> Building model')
# rknn.build(do_quantization=False,do_quantization=True, dataset='dataset.txt')
rknn.build(do_quantization=False)
print('done')
# Export RKNN Model
rknn.export_rknn('./facenet_Reshape_1.rknn')
rknn.release()
我这个成功了 |
|