You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/29 14:05:36 UTC

[GitHub] TaoLv opened a new issue #10316: MultiBoxDetection cannot pass consistency check

TaoLv opened a new issue #10316: MultiBoxDetection cannot pass consistency check
URL: https://github.com/apache/incubator-mxnet/issues/10316
 
 
   I am trying to add a unit test for MultiBoxDetection to check the consistency between cpu and gpu. But it cannot pass on my machine (skylake + p100) with latest master branch.
   
   code:
   ```
   def test_multibox_detection():
       ctx_list = [{'ctx': mx.cpu(0),
                    'detection_cls_prob': (1, 21, 6132),
                    'detection_loc_pred': (1, 24528),
                    'detection_anchor': (1, 6132, 4),
                    'type_dict': {'detection_cls_prob': np.float32,
                                  'detection_loc_pred': np.float32,
                                  'detection_anchor': np.float32}},
                   {'ctx': mx.gpu(0),
                    'detection_cls_prob': (1, 21, 6132),
                    'detection_loc_pred': (1, 24528),
                    'detection_anchor': (1, 6132, 4),
                    'type_dict': {'detection_cls_prob': np.float32,
                                  'detection_loc_pred': np.float32,
                                  'detection_anchor': np.float32}},]
       sym = mx.symbol.contrib.MultiBoxDetection(name='detection', nms_threshold=0.5, force_suppress=False,
                                                 variances=(0.1, 0.1, 0.1, 0.1), nms_topk=400)
       check_consistency(sym, ctx_list)
   ```
   output:
   ```
   ======================================================================
   FAIL: test_operator_gpu.test_multibox_detection
   ----------------------------------------------------------------------
   Traceback (most recent call last):
     File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
       self.test(*self.arg)
     File "/home/lvtao/Workspace/mxnet-official/tests/python/gpu/../unittest/common.py", line 157, in test_new
       orig_test(*args, **kwargs)
     File "/home/lvtao/Workspace/mxnet-official/tests/python/gpu/test_operator_gpu.py", line 1801, in test_multibox_detection
       check_consistency(sym, ctx_list)
     File "/home/lvtao/Workspace/mxnet-official/python/mxnet/test_utils.py", line 1319, in check_consistency
       raise e
   AssertionError:
   Items are not equal:
   Error 1232.413086 exceeds tolerance rtol=0.001000, atol=0.001000.  Location of maximum error:(0, 1619, 1), a=2.172774, b=0.421231
    a: array([[[ 18.        ,   4.28585577,   0.        ,   0.        ,
              0.6093576 ,   0.        ],
           [  8.        ,   4.2417717 ,   1.        ,   0.71296334,...
    b: array([[[ 18.        ,   4.28585577,   0.        ,   0.        ,
              0.6093576 ,   0.        ],
           [  8.        ,   4.2417717 ,   1.        ,   0.7129634 ,...
   -------------------- >> begin captured stdout << ---------------------
   Predict Err: ctx 1 vs ctx 0 at detection_output
   ```
   Input shape and parameters are all from ssd example. 
   @zhreshold I notice that MultiBoxDetection was first committed by you. So may I have your suggestion about this?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services