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/01/09 12:26:44 UTC

[GitHub] KineticCookie opened a new issue #9361: infer_shape error for 'resnet-152'

KineticCookie opened a new issue #9361: infer_shape error for 'resnet-152'
URL: https://github.com/apache/incubator-mxnet/issues/9361
 
 
   ## Description
   Hello. I ran to a problem with a model described in https://mxnet.incubator.apache.org/tutorials/python/predict_image.html
   I tried to infer shapes for model inputs but encountered an error.
   
   ## Environment info (Required)
   
   ```
   ----------Python Info----------
   Version      : 3.6.4
   Compiler     : GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)
   Build        : ('default', 'Dec 21 2017 15:39:08')
   Arch         : ('64bit', '')
   ------------Pip Info-----------
   Version      : 9.0.1
   Directory    : /Users/bulat/anaconda/envs/mxnet/lib/python3.6/site-packages/pip
   ----------MXNet Info-----------
   Version      : 1.0.0
   Directory    : /Users/bulat/anaconda/envs/mxnet/lib/python3.6/site-packages/mxnet
   Commit Hash   : fe80b1c812237ca228fdff4fe48f3b13eb69bc3e
   ----------System Info----------
   Platform     : Darwin-16.7.0-x86_64-i386-64bit
   system       : Darwin
   node         : mbpro.local
   release      : 16.7.0
   version      : Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64
   ----------Hardware Info----------
   machine      : x86_64
   processor    : i386
   b'machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP TSCI'
   b'machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 HLE AVX2 BMI2 INVPCID RTM SMAP RDSEED ADX IPT SGX FPU_CSDS MPX CLFSOPT'
   b'machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C'
   b'machdep.cpu.brand_string: Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz'
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0875 sec, LOAD: 1.1388 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.1118 sec, LOAD: 0.1954 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.5085 sec, LOAD: 0.9550 sec.
   Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.1705 sec, LOAD: 1.2387 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0323 sec, LOAD: 0.5678 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0450 sec, LOAD: 0.1672 sec.
   ```
   
   Package used (Python/R/Scala/Julia):
   I'm using Python 3.6 package.
   
   ## Error Message:
   infer_shape error. Arguments:
   
   ---------------------------------------------------------------------------
   MXNetError                                Traceback (most recent call last)
   <ipython-input-3-348a911fa1f1> in <module>()
         5  mx.test_utils.download(path+'synset.txt')]
         6 sym, arg_params, aux_params = mx.model.load_checkpoint('resnet-152', 0)
   ----> 7 sym.infer_shape()
   
   ~/anaconda/envs/mxnet/lib/python3.6/site-packages/mxnet/symbol/symbol.py in infer_shape(self, *args, **kwargs)
       963         """
       964         try:
   --> 965             res = self._infer_shape_impl(False, *args, **kwargs)
       966             if res[1] is None:
       967                 arg_shapes, _, _ = self._infer_shape_impl(True, *args, **kwargs)
   
   ~/anaconda/envs/mxnet/lib/python3.6/site-packages/mxnet/symbol/symbol.py in _infer_shape_impl(self, partial, *args, **kwargs)
      1093             ctypes.byref(aux_shape_ndim),
      1094             ctypes.byref(aux_shape_data),
   -> 1095             ctypes.byref(complete)))
      1096         if complete.value != 0:
      1097             arg_shapes = [
   
   ~/anaconda/envs/mxnet/lib/python3.6/site-packages/mxnet/base.py in check_call(ret)
       144     """
       145     if ret != 0:
   --> 146         raise MXNetError(py_str(_LIB.MXGetLastError()))
       147 
       148 
   
   MXNetError: Error in operator bn_data: [15:17:50] src/operator/batch_norm-inl.h:239: Check failed: channelAxis < dshape.ndim() (1 vs. 0) Channel axis out of range: 1
   
   Stack trace returned 7 entries:
   [bt] (0) 0   libmxnet.so                         0x00000001055c1598 _ZN4dmlc15LogMessageFatalD2Ev + 40
   [bt] (1) 1   libmxnet.so                         0x00000001066a3b00 _ZNK5mxnet2op13BatchNormProp10InferShapeEPNSt3__16vectorIN4nnvm6TShapeENS2_9allocatorIS5_EEEES9_S9_ + 1968
   [bt] (2) 2   libmxnet.so                         0x000000010668dbee _ZN5mxnet2op16OpPropInferShapeERKN4nnvm9NodeAttrsEPNSt3__16vectorINS1_6TShapeENS5_9allocatorIS7_EEEESB_ + 878
   [bt] (3) 3   libmxnet.so                         0x0000000106530cca _ZZN5mxnet4exec9InferAttrIN4nnvm6TShapeENSt3__18functionIFbRKNS2_9NodeAttrsEPNS4_6vectorIS3_NS4_9allocatorIS3_EEEESD_EEEZNS0_10InferShapeEONS2_5GraphEOSC_RKNS4_12basic_stringIcNS4_11char_traitsIcEENSA_IcEEEEE3$_0DnEESG_SH_T_PKcST_ST_ST_ST_T1_T2_bST_NS_12DispatchModeEENKUljbE_clEjb + 1978
   [bt] (4) 4   libmxnet.so                         0x000000010652960e _ZN5mxnet4exec10InferShapeEON4nnvm5GraphEONSt3__16vectorINS1_6TShapeENS4_9allocatorIS6_EEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS7_IcEEEE + 4542
   [bt] (5) 5   libmxnet.so                         0x00000001064d70a9 MXSymbolInferShape + 2281
   [bt] (6) 6   libffi.6.dylib                      0x00000001036e6884 ffi_call_unix64 + 76
   
   ## Minimum reproducible example
   ```python
   import mxnet as mx
   path='http://data.mxnet.io/models/imagenet-11k/'
   [mx.test_utils.download(path+'resnet-152/resnet-152-symbol.json'),
    mx.test_utils.download(path+'resnet-152/resnet-152-0000.params'),
    mx.test_utils.download(path+'synset.txt')]
   sym, arg_params, aux_params = mx.model.load_checkpoint('resnet-152', 0)
   sym.infer_shape()
   ```
   
   ## Steps to reproduce
   1. pip install mxnet
   2. Run the code specified above
   
   ## What have you tried to solve it?
   
   1. Install mxnet v0.11
   2. Create new venv and run it there
   

----------------------------------------------------------------
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