wenyangchu opened a new issue #13750: mx.nd.Crop does not support FP16 and decpreciated but no direct alternative with central crop URL: https://github.com/apache/incubator-mxnet/issues/13750 Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form. For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io ## Description I have been using mx.nd.Crop with "crop_like" behavior in Float32 training. When I switch to train network in 16 bit, it throws errors. This function is depreciated, but I do not find direct alternative. The closest one is mx.nd.slice_like but it does not have central crop option. ## Environment info (Required) ----------Python Info---------- ('Version :', '2.7.12') ('Compiler :', 'GCC 5.4.0 20160609') ('Build :', ('default', 'Dec 4 2017 14:50:18')) ('Arch :', ('64bit', 'ELF')) ------------Pip Info----------- ('Version :', '18.1') ('Directory :', '/data/wy/mxnet130/local/lib/python2.7/site-packages/pip') ----------MXNet Info----------- ('Version :', '1.3.1') ('Directory :', '/data/wy/mxnet130/local/lib/python2.7/site-packages/mxnet') ('Commit Hash :', '91c1f821c7816d59d666d21549ac524c863c46b2') ----------System Info---------- ('Platform :', 'Linux-4.4.0-139-generic-x86_64-with-Ubuntu-16.04-xenial') ('system :', 'Linux') ('node :', 'ae') ('release :', '4.4.0-139-generic') ('version :', '#165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018') ----------Hardware Info---------- ('machine :', 'x86_64') ('processor :', 'x86_64') Package used: Python ## Error Message: MXNetErrorTraceback (most recent call last) <ipython-input-66-21a7fd8f35b8> in <module>() 1 data_cut = mx.nd.slice_like(data=data,shape_like=data_ref,axes =(2,3)) ----> 2 cropped = mx.nd.Crop(data,data_ref, num_args = 2, center_crop = True, name = 'cropped') /data/wy/mxnet130/local/lib/python2.7/site-packages/mxnet/ndarray/register.pyc in Crop(*data, **kwargs) /data/wy/mxnet130/local/lib/python2.7/site-packages/mxnet/_ctypes/ndarray.pyc in _imperative_invoke(handle, ndargs, keys, vals, out) 90 c_str_array(keys), 91 c_str_array([str(s) for s in vals]), ---> 92 ctypes.byref(out_stypes))) 93 94 if original_output is not None: /data/wy/mxnet130/local/lib/python2.7/site-packages/mxnet/base.pyc in check_call(ret) 250 """ 251 if ret != 0: --> 252 raise MXNetError(py_str(_LIB.MXGetLastError())) 253 254 MXNetError: [12:50:35] include/mxnet/operator.h:228: Check failed: in_type->at(i) == mshadow::default_type_flag || in_type->at(i) == -1 Unsupported data type 2 ## Steps to reproduce (Paste the commands you ran that produced the error.) import mxnet as mx data = mx.nd.random.uniform(shape=(1,3,10,10),dtype='float16') data_ref = mx.nd.ones((1,3,6,6),dtype='float16') cropped = mx.nd.Crop(data,data_ref, num_args = 2, center_crop = True, name = 'cropped') ## What have you tried to solve it? 1. I tried to use slice_like to replace crop but I found out that central crop function is missing.
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
