|
本帖最后由 liuwenhua 于 2019-11-18 16:01 编辑
import numpy as np
import cv2
from PIL import Image
from rknn.api import RKNN
from timeit import default_timer as timer
#rknn = RKNN()
rknn = RKNN(verbose=True, verbose_file='./1.log')
#rknn.config(channel_mean_value='0 0 0 1', reorder_channel='0 1 2')
#load tensorflow model
print('--> Loading model')
rknn.load_tensorflow(tf_pb='./20191115-074450.pb',inputs=['input'],outputs=['InceptionResnetV1/Bottleneck/BatchNorm/Reshape_1'],
input_size_list=[[160, 160, 3]])
#print("aa",aa)
print('done')
# Build Model
print('--> Building model')
#rknn.build(do_quantization=True, dataset='./datasets.txt')
#rknn.build(do_quantization=True,dataset='./datasets.txt',pre_compile=False)
rknn.build(do_quantization=False)
print('done')
# Export RKNN Model
rknn.export_rknn('./20191115-074450.rknn')
rknn.release()
最终推理结果与原始模型推理相差比较大,根本无法识别
|
|