KL720 resnet特徵向量輸出inference輸出不是預期

整個模型是由 backbone , neck ,head組成,在加速棒inference的只有backbone

backbone使用resnet50(刪除最後的 稠密層 扁平層及三層捲積層)輸出是1*1024*20*20

轉換成optimized後的onnx模型輸出都是正確的,已使用onnx inference方法驗證,但在移植到KL720後推論的結果不一致。(使用KneronPLUS 1.3.0)

圖片輸入預處理是

#輸入是1x3x320x320
z_patch = normalize(z_patch.squeeze()/255.,
                    mean=[0.485, 0.456, 0.406],
                    std=[0.229, 0.224, 0.225]).unsqueeze(0)

我將提供:

1.onnx的模型

2.onnx inference file

3.Kneron inference python file

4.onnx2nef python file

謝謝你的幫助

Tagged:

Comments

The discussion has been closed due to inactivity. To continue with the topic, please feel free to post a new discussion.