chrishkchris opened a new issue #576: The python test case in test_operation.py may need to be updated URL: https://github.com/apache/singa/issues/576 Today when I run the singa/test/python/test_operation.py, I get these errors: ``` ubuntu@ip-172-31-24-48:~/singa/test/python$ python3 test_operation.py ..................................................................E.FF..............................FF.....FF................ ====================================================================== ERROR: test_conv2d_cpu (__main__.TestPythonOperation) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_operation.py", line 216, in test_conv2d_cpu y = conv_1(cpu_input_tensor) # PyTensor File "/home/ubuntu/singa/build/python/singa/autograd.py", line 1380, in __call__ y = conv2d(self.handle, x, self.W, self.b) File "/home/ubuntu/singa/build/python/singa/autograd.py", line 1241, in conv2d return _Conv2d(handle)(x, W, b)[0] File "/home/ubuntu/singa/build/python/singa/autograd.py", line 247, in __call__ return self._do_forward(*xs) File "/home/ubuntu/singa/build/python/singa/autograd.py", line 298, in _do_forward ys = self.forward(*xs) File "/home/ubuntu/singa/build/python/singa/autograd.py", line 1203, in forward return singa.GpuConvForward(x, W, b, self.handle) TypeError: in method 'GpuConvForward', argument 4 of type 'singa::CudnnConvHandle const &' ====================================================================== FAIL: test_div_broadcast_cpu (__main__.TestPythonOperation) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_operation.py", line 2616, in test_div_broadcast_cpu np.testing.assert_array_almost_equal(tensor.to_numpy(tensor.from_raw_tensor(dx1)), grad1, decimal=5) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 1007, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 819, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals Mismatch: 3.33% Max absolute difference: 3.0517578e-05 Max relative difference: 9.684139e-07 x: array([[-1.30722e+01, 2.65515e+00, -6.92423e-02, -2.97908e-01, 6.12429e+00, 3.71461e-01], [ 1.33601e+01, -4.65283e+00, -4.74600e-01, -9.15998e-01,... y: array([[-1.30722e+01, 2.65515e+00, -6.92423e-02, -2.97908e-01, 6.12429e+00, 3.71461e-01], [ 1.33601e+01, -4.65283e+00, -4.74600e-01, -9.15998e-01,... ====================================================================== FAIL: test_div_broadcast_gpu (__main__.TestPythonOperation) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_operation.py", line 2584, in test_div_broadcast_gpu np.testing.assert_array_almost_equal(tensor.to_numpy(tensor.from_raw_tensor(dx1)), grad1, decimal=5) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 1007, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 819, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals Mismatch: 40% Max absolute difference: 6.1035156e-05 Max relative difference: 3.51512e-07 x: array([-173.63599, -30.95938, 139.375 , -4.83802, -2.26971], dtype=float32) y: array([-173.63605, -30.95938, 139.37502, -4.83802, -2.26971], dtype=float32) ====================================================================== FAIL: test_pow_broadcast_cpu (__main__.TestPythonOperation) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_operation.py", line 2678, in test_pow_broadcast_cpu np.testing.assert_array_almost_equal(tensor.to_numpy(tensor.from_raw_tensor(dx1)), grad1, decimal=5) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 1007, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 819, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals Mismatch: 40% Max absolute difference: 6.1035156e-05 Max relative difference: 1.3951524e-07 x: array([ 169.04495, -238.43016, 1852.8772 , 437.48016, -20.75186], dtype=float32) y: array([ 169.04497, -238.43016, 1852.8772 , 437.48022, -20.75186], dtype=float32) ====================================================================== FAIL: test_pow_broadcast_gpu (__main__.TestPythonOperation) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_operation.py", line 2645, in test_pow_broadcast_gpu np.testing.assert_array_almost_equal(tensor.to_numpy(result), y, decimal=5) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 1007, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 819, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals Mismatch: 6.67% Max absolute difference: 6.1035156e-05 Max relative difference: 8.3724494e-08 x: array([[[ 1. , 216. , 64. , 36. , 343. ], [ 27. , 125. , 512. , 36. , 343. ], [ 1. , 343. , 1. , 81. , 343. ],... y: array([[[ 1., 216., 64., 36., 343.], [ 27., 125., 512., 36., 343.], [ 1., 343., 1., 81., 343.],... ====================================================================== FAIL: test_reshape_cpu (__main__.TestPythonOperation) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_operation.py", line 1455, in test_reshape_cpu np.testing.assert_array_almost_equal(tensor.to_numpy(tensor.from_raw_tensor(dx)), grad, decimal=5) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 1007, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 752, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals (shapes (2, 3), (3, 2) mismatch) x: array([[1., 1., 1.], [1., 1., 1.]], dtype=float32) y: array([[1., 1.], [1., 1.], [1., 1.]], dtype=float32) ====================================================================== FAIL: test_reshape_gpu (__main__.TestPythonOperation) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_operation.py", line 1475, in test_reshape_gpu np.testing.assert_array_almost_equal(tensor.to_numpy(tensor.from_raw_tensor(dx)), grad, decimal=5) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 1007, in assert_array_almost_equal precision=decimal) File "/usr/local/lib/python3.5/dist-packages/numpy/testing/_private/utils.py", line 752, in assert_array_compare raise AssertionError(msg) AssertionError: Arrays are not almost equal to 5 decimals (shapes (2, 3), (3, 2) mismatch) x: array([[1., 1., 1.], [1., 1., 1.]], dtype=float32) y: array([[1., 1.], [1., 1.], [1., 1.]], dtype=float32) ---------------------------------------------------------------------- Ran 125 tests in 0.586s FAILED (failures=6, errors=1) ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
