Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Operators #738

Merged
merged 5 commits into from
Sep 18, 2020
Merged

Adding Operators #738

merged 5 commits into from
Sep 18, 2020

Conversation

Shashankwer
Copy link
Contributor

Added the Floor operator in autograd.py,test_operation.py and sonnx.py

Added Abs in sonnx.py

Added the Floor operator in autograd.py test_operation.py and sonnx.py

Added Abs in sonnx.py
@joddiy
Copy link
Member

joddiy commented Jun 16, 2020

@Shashankwer Hi, thanks for your contribution.

Have you tried to run the test_operation.py and test_onnx_backed.py to test the operator?

@Shashankwer
Copy link
Contributor Author

Hi @joddiy,

Can you help me knowing the process for setting the current dev environment as the singa package. I am using MAC with singa environment 3.0.0.rc1 py37cpu.

While running test_operation.py following error is reported

AttributeError: module 'singa.singa_wrap' has no attribute 'Floor'

The dev consist an implementation of Floor in 'tensor_math.cpp'

Thanks and Regards,
Shashank Nigam

Corrected the superclass to Operation
@chrishkchris
Copy link
Contributor

Hi @joddiy,

Can you help me knowing the process for setting the current dev environment as the singa package. I am using MAC with singa environment 3.0.0.rc1 py37cpu.

While running test_operation.py following error is reported

AttributeError: module 'singa.singa_wrap' has no attribute 'Floor'

The dev consist an implementation of Floor in 'tensor_math.cpp'

Thanks and Regards,
Shashank Nigam

How about using this cpu docker environment
https://github.com/apache/singa/blob/master/tool/docker/devel/ubuntu/cpu/Dockerfile
and adding
git checkout dev after line 65?

@Shashankwer
Copy link
Contributor Author

Thanks will try

Made changes in autograd.py after making changes in test_operation
@Shashankwer
Copy link
Contributor Author

test_operation
Hi,

In docker I am able to view the changes work on dev branch. test_operation.py did not result in any errors resulting in floor which was implemented Attached is the screen shot of the same

However test_onnx_backend.py resulted in ss.Segmentation fault (core dumped)
This was irrespective to the changes made to the sonnx.py file. Request your kind guidance on the same

Thanks and Regards,
Shashank Nigam

@joddiy
Copy link
Member

joddiy commented Jun 18, 2020

test_operation
Hi,

In docker I am able to view the changes work on dev branch. test_operation.py did not result in any errors resulting in floor which was implemented Attached is the screen shot of the same

However test_onnx_backend.py resulted in ss.Segmentation fault (core dumped)
This was irrespective to the changes made to the sonnx.py file. Request your kind guidance on the same

Thanks and Regards,
Shashank Nigam

Please skip this error 'Gemm.w', the reason is someone modified the method by which we get the parameter, and I've fixed this error in another PR, https://github.com/apache/singa/pull/734/files#diff-c0a014dc6b3a07acd5e7c10001de82c9R2523-R2524

And for the Segmentation fault, I guess it is because the environment, I'm checking this with Chris.

@chrishkchris
Copy link
Contributor

test_operation
Hi,

In docker I am able to view the changes work on dev branch. test_operation.py did not result in any errors resulting in floor which was implemented Attached is the screen shot of the same

However test_onnx_backend.py resulted in ss.Segmentation fault (core dumped)
This was irrespective to the changes made to the sonnx.py file. Request your kind guidance on the same

Thanks and Regards,
Shashank Nigam

FYI, the bug fix of seg fault is merged

@Shashankwer
Copy link
Contributor Author

Thanks,

Will test the code again and update accordingly

@Shashankwer
Copy link
Contributor Author

Shashankwer commented Jun 19, 2020

Hi @chrishkchris, @joddiy

Test_operation.py gives the following results

.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.ss.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s
----------------------------------------------------------------------
Ran 181 tests in 0.892s

Test_onnx_backend.py results in following error:

/usr/local/lib/python3.6/dist-packages/singa-3.0.0-py3.6.egg/singa/sonnx.py:1844: UserWarning: The imported ir verion 6 is larger than the supported version 12.
  .format(cls._ir_version, imp.version))
.sssssssssssssssss.s.s.s.s.s.sssss.s.sssss.s.s.s.sFs.s.s.s.s.s.sssssssss.s.s.s.s.s.s.s.s.s.s.s.sssss.sFloating point exception (core dumped)

Kindly let me know if any environment changes needs to ne made.

Thanks and Regards,
Shashank Nigam

@chrishkchris
Copy link
Contributor

chrishkchris commented Jun 19, 2020

maybe you can try add the following two lines and rebuild docker:

  1. https://github.com/apache/singa/blob/master/tool/docker/devel/ubuntu/cuda10/Dockerfile#L59
  2. https://github.com/apache/singa/blob/master/tool/docker/devel/ubuntu/cuda10/Dockerfile#L102

FYI, "s" means skip, which skip the GPU test in CPU version

@Shashankwer
Copy link
Contributor Author

Hi @chrishkchris ,

The environment contains onnx version 1.7.0(installed later through pip) and it is in dev branch

Thanks and Regards,
Shashank Nigam

@chrishkchris
Copy link
Contributor

Hi @chrishkchris ,

The environment contains onnx version 1.7.0(installed later through pip) and it is in dev branch

Thanks and Regards,
Shashank Nigam

we locked both conda and docker version of onnx 1.6.0. Please try onnx 1.6.0

@Shashankwer
Copy link
Contributor Author

Hi,

The test_onnx_backend.py did not gave any error for Floor or Abs added. However following error with maxpool2d was generated

.s.s.s.s.s.s.s.s.s.s.s.s.s.s.sssssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.sssss.sss.sss.s.s.sFsFs.sssssssssss.sssssssssssssssss.s.s.s.s.s.sssss.s.s.s.s.s.s.s.s.s.sssssssss.s.s.s.s.s.s.s.s.s.s.s.sssss.s.sssssssssssssssssssssssssss.s.s.s.sssssssssssssssssssssssssssss.s.s.s.s.sssssssssssssss.s.s.sFsFsss.s.s.s.sssssss.s.s.s.s.s.s.s.s.s.s.s.s.sssssss.sssss.s.s.s.s.sss.s.s.s.s.s.s.sssss.s.sssssssssssssssssssss.s.s.s.sssssssssssss.s.s.s.s.s.s.sssssssssssssssssssssssss.s.s.sss.s.s.sssss.sss.s.s.s.sFsFs.sssssssssss.s.s.s.s.s.sssssssssssssssssssssssssss.s.s.sssss.s.sssssssssssssssssss.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.sss.s.s.s.sssssssssssssssss.s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.sssssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.sssssssssssssssssss.s.s.s.s.s.s.s.s.s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.s.s.s.s.sssss.s.s.sssss.s.s.s.sssss.s.s.s.s.s.s.sss.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.sssssssssssss.s.s.s.s.s.s.s.s.s.sssssssssssssssssssss.s.sssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.s.sssss.s.s.s.s.s.s.s.s
======================================================================
FAIL: test_averagepool_2d_same_lower_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 189 / 3072 (6.15%)
Max absolute difference: 1.3230393
Max relative difference: 3.
 x: array([[[[ 1.764052e+00,  1.082105e+00,  6.894476e-01, ...,
           1.501069e+00,  8.121531e-01,  2.665550e-01],
         [ 4.381333e-01, -1.760931e-01, -2.374533e-01, ...,...
 y: array([[[[ 4.410131e-01,  5.410524e-01,  3.447238e-01, ...,
           7.505345e-01,  4.060766e-01,  1.332775e-01],
         [ 2.190667e-01, -1.760931e-01, -2.374533e-01, ...,...

======================================================================
FAIL: test_averagepool_2d_same_upper_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 189 / 3072 (6.15%)
Max absolute difference: 0.9547153
Max relative difference: 3.
 x: array([[[[-0.176093, -0.237453,  0.757017, ...,  0.112902, -0.50158 ,
          -0.67406 ],
         [-0.773234, -1.090172, -0.339745, ...,  0.040076, -0.369122,...
 y: array([[[[-0.176093, -0.237453,  0.757017, ...,  0.112902, -0.50158 ,
          -0.33703 ],
         [-0.773234, -1.090172, -0.339745, ...,  0.040076, -0.369122,...

======================================================================
FAIL: test_equal_bcast_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 1 / 60 (1.67%)
 x: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False, False],...
 y: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False, False],...

======================================================================
FAIL: test_equal_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 1 / 60 (1.67%)
 x: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False,  True],...
 y: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False,  True],...

======================================================================
FAIL: test_maxpool_2d_same_lower_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 35 / 3072 (1.14%)
Max absolute difference: 1.6961312
Max relative difference: 0.
 x: array([[[[ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,
           1.532779e+00,  1.469359e+00,  3.781625e-01],
         [ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,...
 y: array([[[[ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,
           1.532779e+00,  1.469359e+00,  3.781625e-01],
         [ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,...

======================================================================
FAIL: test_maxpool_2d_same_upper_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 37 / 3072 (1.2%)
Max absolute difference: 1.2028884
Max relative difference: 0.
 x: array([[[[ 1.764052,  0.978738,  2.240893, ...,  1.469359,  0.378163,
           0.378163],
         [ 0.177426, -0.347912,  0.462782, ...,  0.976639,  0.706573,...
 y: array([[[[ 1.764052,  0.978738,  2.240893, ...,  1.469359,  0.378163,
           0.378163],
         [ 0.177426, -0.347912,  0.462782, ...,  0.976639,  0.706573,...

----------------------------------------------------------------------
Ran 1114 tests in 1.197s

FAILED (failures=6, skipped=852)

Thanks and Regards,
Shashank

@joddiy
Copy link
Member

joddiy commented Jun 19, 2020

Hi,

The test_onnx_backend.py did not gave any error for Floor or Abs added. However following error with maxpool2d was generated

.s.s.s.s.s.s.s.s.s.s.s.s.s.s.sssssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.sssss.sss.sss.s.s.sFsFs.sssssssssss.sssssssssssssssss.s.s.s.s.s.sssss.s.s.s.s.s.s.s.s.s.sssssssss.s.s.s.s.s.s.s.s.s.s.s.sssss.s.sssssssssssssssssssssssssss.s.s.s.sssssssssssssssssssssssssssss.s.s.s.s.sssssssssssssss.s.s.sFsFsss.s.s.s.sssssss.s.s.s.s.s.s.s.s.s.s.s.s.sssssss.sssss.s.s.s.s.sss.s.s.s.s.s.s.sssss.s.sssssssssssssssssssss.s.s.s.sssssssssssss.s.s.s.s.s.s.sssssssssssssssssssssssss.s.s.sss.s.s.sssss.sss.s.s.s.sFsFs.sssssssssss.s.s.s.s.s.sssssssssssssssssssssssssss.s.s.sssss.s.sssssssssssssssssss.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.sss.s.s.s.sssssssssssssssss.s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.sssssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.sssssssssssssssssss.s.s.s.s.s.s.s.s.s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.s.s.s.s.sssss.s.s.sssss.s.s.s.sssss.s.s.s.s.s.s.sss.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.sssssssssssss.s.s.s.s.s.s.s.s.s.sssssssssssssssssssss.s.sssssssssssssssssssssssssssssss.s.s.s.s.s.s.s.s.sssss.s.s.s.s.s.s.s.s
======================================================================
FAIL: test_averagepool_2d_same_lower_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 189 / 3072 (6.15%)
Max absolute difference: 1.3230393
Max relative difference: 3.
 x: array([[[[ 1.764052e+00,  1.082105e+00,  6.894476e-01, ...,
           1.501069e+00,  8.121531e-01,  2.665550e-01],
         [ 4.381333e-01, -1.760931e-01, -2.374533e-01, ...,...
 y: array([[[[ 4.410131e-01,  5.410524e-01,  3.447238e-01, ...,
           7.505345e-01,  4.060766e-01,  1.332775e-01],
         [ 2.190667e-01, -1.760931e-01, -2.374533e-01, ...,...

======================================================================
FAIL: test_averagepool_2d_same_upper_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 189 / 3072 (6.15%)
Max absolute difference: 0.9547153
Max relative difference: 3.
 x: array([[[[-0.176093, -0.237453,  0.757017, ...,  0.112902, -0.50158 ,
          -0.67406 ],
         [-0.773234, -1.090172, -0.339745, ...,  0.040076, -0.369122,...
 y: array([[[[-0.176093, -0.237453,  0.757017, ...,  0.112902, -0.50158 ,
          -0.33703 ],
         [-0.773234, -1.090172, -0.339745, ...,  0.040076, -0.369122,...

======================================================================
FAIL: test_equal_bcast_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 1 / 60 (1.67%)
 x: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False, False],...
 y: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False, False],...

======================================================================
FAIL: test_equal_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 1 / 60 (1.67%)
 x: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False,  True],...
 y: array([[[False, False, False, False, False],
        [False, False, False, False, False],
        [False, False, False, False,  True],...

======================================================================
FAIL: test_maxpool_2d_same_lower_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 35 / 3072 (1.14%)
Max absolute difference: 1.6961312
Max relative difference: 0.
 x: array([[[[ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,
           1.532779e+00,  1.469359e+00,  3.781625e-01],
         [ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,...
 y: array([[[[ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,
           1.532779e+00,  1.469359e+00,  3.781625e-01],
         [ 1.764052e+00,  1.764052e+00,  9.787380e-01, ...,...

======================================================================
FAIL: test_maxpool_2d_same_upper_cpu (__main__.OnnxBackendNodeModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 248, in device_test_func
    return test_func(*args, device=device, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 313, in run
    atol=model_test.atol)
  File "/usr/local/lib/python3.6/dist-packages/onnx/backend/test/runner/__init__.py", line 178, in assert_similar_outputs
    atol=atol)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python3.6/dist-packages/numpy/testing/_private/utils.py", line 846, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.001, atol=1e-07

Mismatched elements: 37 / 3072 (1.2%)
Max absolute difference: 1.2028884
Max relative difference: 0.
 x: array([[[[ 1.764052,  0.978738,  2.240893, ...,  1.469359,  0.378163,
           0.378163],
         [ 0.177426, -0.347912,  0.462782, ...,  0.976639,  0.706573,...
 y: array([[[[ 1.764052,  0.978738,  2.240893, ...,  1.469359,  0.378163,
           0.378163],
         [ 0.177426, -0.347912,  0.462782, ...,  0.976639,  0.706573,...

----------------------------------------------------------------------
Ran 1114 tests in 1.197s

FAILED (failures=6, skipped=852)

Thanks and Regards,
Shashank

Hi, @Shashankwer , thanks.

These errors mostly take place because of float precision. You can just ignore these.

@Shashankwer
Copy link
Contributor Author

Hi,

Floor and Abs then pass the test of both test_operator.py and test_onnx_backend.py

Thanks and Regards,
Shashank Nigam

@joddiy
Copy link
Member

joddiy commented Jun 22, 2020

Thanks @Shashankwer , I hope you have been familiar with the code during you're testing these operators. I guess you can work on more complicated operators now.

@nudles This PR is ready to merge.

@Shashankwer
Copy link
Contributor Author

Hi @joddiy,

Working on further changes, Exp, and round will push the changes shortly. Also working on rest of the operators mentioned in the Issue

Thanks,
Shashank Nigam

@joddiy
Copy link
Member

joddiy commented Jun 22, 2020

Hi @joddiy,

Working on further changes, Exp, and round will push the changes shortly. Also working on rest of the operators mentioned in the Issue

Thanks,
Shashank Nigam

please check the comment here, #700 (comment)

The Exp and round have been implemented already, you can try this one.

ScatterElements 12h

I've checked the manual, it isn't too complicated.

You can follow this: https://github.com/onnx/onnx/blob/master/docs/Operators.md#ScatterElements

@Shashankwer
Copy link
Contributor Author

Thanks working in ScatterElements

@joddiy joddiy merged commit fb9be0f into apache:dev Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants