|
如题,onnx模型是github上找的ArcFace模型(https://github.com/onnx/models/tree/master/models/face_recognition/ArcFace),加载报错。求解
代码如下:
import cv2
from rknn.api import RKNN
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN()
# pre-process config
print('--> config model')
rknn.config(channel_mean_value='0,0,0,255', reorder_channel='2 1 0')
print('done')
# Load tensorflow model
print('--> Loading model')
ret = rknn.load_onnx(model='./resnet100.onnx')
if ret != 0:
print('Load resnet100 failed! Ret = {}'.format(ret))
exit(ret)
print('done')
# Build model
print('--> Building model')
ret = rknn.build(do_quantization=True, dataset='./dataset.txt')
if ret != 0:
print('Build resnet100 failed!')
exit(ret)
print('done')
# Export rknn model
print('--> Export RKNN model')
ret = rknn.export_rknn('./resnet100.rknn')
if ret != 0:
print('Export mobilenet_v2.rknn failed!')
exit(ret)
print('done')
rknn.release()
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|