Toybrick

标题: load resnet18 onnx模型失败 [打印本页]

作者: FFFOCUS    时间: 2019-7-31 13:28
标题: load resnet18 onnx模型失败
verbose=True
完整的日志


作者: FFFOCUS    时间: 2019-8-1 18:43
模型是自己用pytorch(1.1)训练的,保存成onnx的
转换代码
from rknn.api import RKNN

if __name__ == '__main__':
    rknn = RKNN()
    rknn.config(channel_mean_value='0 0 0 255', reorder_channel='0 1 2')
    print('--> Loading model\n')
    rknn.load_onnx('./resnet.onnx')
    print('done\n')
    print('--> Building model\n')
    rknn.build(do_quantization=False)
    print('done\n')
    rknn.export_rknn('./resnet.rknn')

    # Release RKNN Context
    rknn.release()

作者: zhangyu    时间: 2019-8-2 15:10
FFFOCUS 发表于 2019-8-1 18:43
模型是自己用pytorch(1.1)训练的,保存成onnx的
转换代码
from rknn.api import RKNN

does your pytorch model contain torch.view?
you can just replace it with squeeze/unsqueeze operator.
作者: zhangyu    时间: 2019-8-2 15:13
zhangyu 发表于 2019-8-2 15:10
does your pytorch model contain torch.view?
you can just replace it with squeeze/unsqueeze operato ...

btw, transconv2d has a bug when bias=False. so bias can only be True
作者: FFFOCUS    时间: 2019-8-5 20:07
zhangyu 发表于 2019-8-2 15:13
btw, transconv2d has a bug when bias=False. so bias can only be True

The picture below shows the difference between the public resnet18 with format onnx and my own resnet18 with format onnx which is produced by pytorch(version1.1).




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