We notices that bilinear upsampling behave differently in torch and dlc, and there is discrepancy between the outputs.
Torch use different ratio when multiplying neighbors [0.75, 0.25] than DLC [0.5, 0.5], and the edges is quite different as well. We used snpe-onnx-to-dlc to convert the model.
onnx==1.6.0, onnx_opset_version==11 (BTW we tried opset==10, but torch output was not alligned with onnx)
array([[[ 10., 15., 20., 25., 30., 35., 40., 40.],
[ 30., 35., 40., 45., 50., 55., 60., 60.],
[ 50., 55., 60., 65., 70., 75., 80., 80.],
[ 70., 75., 80., 85., 90., 95., 100., 100.],
[ 90., 95., 100., 105., 110., 115., 120., 120.],
[110., 115., 120., 125., 130., 135., 140., 140.],
[130., 135., 140., 145., 150., 155., 160., 160.],
[130., 135., 140., 145., 150., 155., 160., 160.]]], dtype=float32)
Torch output:
array([[[[ 10. , 12.5, 17.5, 22.5, 27.5, 32.5, 37.5, 40. ],
[ 20. , 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 50. ],
[ 40. , 42.5, 47.5, 52.5, 57.5, 62.5, 67.5, 70. ],
[ 60. , 62.5, 67.5, 72.5, 77.5, 82.5, 87.5, 90. ],
[ 80. , 82.5, 87.5, 92.5, 97.5, 102.5, 107.5, 110. ],
[100. , 102.5, 107.5, 112.5, 117.5, 122.5, 127.5, 130. ],
[120. , 122.5, 127.5, 132.5, 137.5, 142.5, 147.5, 150. ],
[130. , 132.5, 137.5, 142.5, 147.5, 152.5, 157.5, 160. ]]]], dtype=float32)
Dear customer,
Did you check the data with correct format? The data type SNPE recognize is NHWC but ONNX is NCHW.
So, you need to transformer the execution results from NHWC to NCHW and then take a comparsion with golden data.
BR.
Wei