mmagic icon indicating copy to clipboard operation
mmagic copied to clipboard

cpu or gpu,dynamic_export=true or dynamic_export=false ,the result is different

Open Winnie202 opened this issue 3 years ago • 0 comments

I'm using realbasicsvr for pytorch2onnx conversion and I'm having some problems, in the condition of model.cpu().eval(), when using dynamic_export, np.allclose(pytorch_result, onnx_result, rtol=1e-5,atol=1e- 5) The results show The numerical values are the same between Pytorch and ONNX, when dynamic_export is not used, the results of np.allclose (pytorch_result, onnx_result, rtol=1e-5, atol=1e-5) show The outputs are different between Pytorch and ONNX.

But under the condition of model.eval().to('cuda'), np.allclose(pytorch_result, onnx_result, rtol=1e-5, atol=1e-4) can achieve the above results.

Winnie202 avatar Jul 12 '22 11:07 Winnie202