You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
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.
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.
/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?
I tried to use slice_like to replace crop but I found out that central crop function is missing.
The text was updated successfully, but these errors were encountered:
Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Performance, Bug
One more comment: Crop function is depreciated but I don't see the alternative slice function provides the same central crop option. And it has been used for some people including me in the unet like implementation. It is especially important when padding is not desired in the use case of applying unet in an extremely large image to avoid edge effect caused by padding.
I personally think the current Crop function is great and unique compared to tensorflow approach:
After many search and trials I failed to implement the above crop_and_concat function in mxnet using a hybridBlock. I can only do this in the imperative mode. it is not desired because I prefer to export onnx for my deployment. If someone can teach me how to implement the above function right with hybrid block, it is be very appreciated :)
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)
in ()
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?
The text was updated successfully, but these errors were encountered: