Toybrick

标题: onnx模型转rk模型出错 [打印本页]

作者: weidao    时间: 2019-5-15 15:01
标题: onnx模型转rk模型出错
如题,onnx模型是github上找的ArcFace模型(https://github.com/onnx/models/tree/master/models/face_recognition/ArcFace),加载报错。求解
[attach]278[/attach]
代码如下:
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()



作者: yaowei    时间: 2019-5-15 19:20
大佬我们是一样的错误




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3