Having same issue
AssertionError:
Arrays are not almost equal to 3 decimals
(mismatch 99.88639987244898%)
x: array([ 0.271, 0.347, 0.455, ..., -0.064, -0.148, -0.038], dtype=float32)
y: array([ 0.271, 0.473, 0.358, ..., 0.193, 0.505, -0.038], dtype=float32)
here is the full stack trace:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-6-cfccf8d5c977> in <module>
22
23 # Verify the numerical correctness upto 3 decimal places
---> 24 np.testing.assert_almost_equal(torch_out.data.cpu().numpy(), c2_out, decimal=3)
25
26 print("Exported model has been executed on Caffe2 backend, and the result looks good!")
/usr/local/miniconda3/envs/pytorch_onnx/lib/python3.7/site-packages/numpy/testing/_private/utils.py in assert_almost_equal(actual, desired, decimal, err_msg, verbose)
566 if isinstance(actual, (ndarray, tuple, list)) \
567 or isinstance(desired, (ndarray, tuple, list)):
--> 568 return assert_array_almost_equal(actual, desired, decimal, err_msg)
569 try:
570 # If one of desired/actual is not finite, handle it specially here:
/usr/local/miniconda3/envs/pytorch_onnx/lib/python3.7/site-packages/numpy/testing/_private/utils.py in assert_array_almost_equal(x, y, decimal, err_msg, verbose)
971 assert_array_compare(compare, x, y, err_msg=err_msg, verbose=verbose,
972 header=('Arrays are not almost equal to %d decimals' % decimal),
--> 973 precision=decimal)
974
975
/usr/local/miniconda3/envs/pytorch_onnx/lib/python3.7/site-packages/numpy/testing/_private/utils.py in assert_array_compare(comparison, x, y, err_msg, verbose, header, precision, equal_nan, equal_inf)
787 verbose=verbose, header=header,
788 names=('x', 'y'), precision=precision)
--> 789 raise AssertionError(msg)
790 except ValueError:
791 import traceback
My dependecy versions: python 3.7.1, onnx 1.3.0, pytorch-nightly 1.0.0.dev20181222