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

error happen while ocr_train.py. How to fix it? #4

Open
white2018 opened this issue Jul 26, 2017 · 1 comment
Open

error happen while ocr_train.py. How to fix it? #4

white2018 opened this issue Jul 26, 2017 · 1 comment

Comments

@white2018
Copy link

wanghz@S822lc1:~/ocr_recognition/recaptcha$ python ocr_train.py
ocr_train.py:212: DeprecationWarning: mxnet.model.FeedForward has been deprecated. Please use mxnet.mod.Module instead.
magnitude=2.34))
[20:57:11] /home/asiainfo/mxnet/dmlc-core/include/dmlc/./logging.h:308: [20:57:11] src/operator/./slice_channel-inl.h:198: Check failed: ishape[real_axis] == static_cast<size_t>(param_.num_outputs) (3000 vs. 30) If squeeze axis is True, the size of the sliced axis must be the same as num_outputs. Input shape=(100,3000), axis=1, num_outputs=30.

Stack trace returned 10 entries:
[bt] (0) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4dmlc15LogMessageFatalD1Ev+0x58) [0x3fff648bbc08]
[bt] (1) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(ZNK5mxnet2op16SliceChannelProp10InferShapeEPSt6vectorIN4nnvm6TShapeESaIS4_EES7_S7+0x65c) [0x3fff656ea52c]
[bt] (2) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x11cc178) [0x3fff653ac178]
[bt] (3) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(ZNSt17_Function_handlerIFbRKN4nnvm9NodeAttrsEPSt6vectorINS0_6TShapeESaIS5_EES8_EPS9_E9_M_invokeERKSt9_Any_dataS3_OS8_SF+0x34) [0x3fff648ada74]
[bt] (4) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x247e0c0) [0x3fff6665e0c0]
[bt] (5) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x247f78c) [0x3fff6665f78c]
[bt] (6) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x248077c) [0x3fff6666077c]
[bt] (7) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4nnvm11ApplyPassesENS_5GraphERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x360) [0x3fff6668d380]
[bt] (8) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4nnvm9ApplyPassENS_5GraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x260) [0x3fff6579e4b0]
[bt] (9) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4nnvm4pass10InferShapeENS_5GraphESt6vectorINS_6TShapeESaIS3_EENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x210) [0x3fff657a3620]

infer_shape error. Arguments:
label: (100, 4)
l0_init_c: (100, 128)
l1_init_h: (100, 128)
l0_init_h: (100, 128)
data: (100, 3000)
l1_init_c: (100, 128)
Traceback (most recent call last):
File "ocr_train.py", line 230, in
batch_end_callback=mx.callback.Speedometer(BATCH_SIZE, 100), logger=logger)
File "/usr/local/lib/python2.7/dist-packages/mxnet/model.py", line 782, in fit
self._init_params(data.provide_data+data.provide_label)
File "/usr/local/lib/python2.7/dist-packages/mxnet/model.py", line 502, in _init_params
arg_shapes, _, aux_shapes = self.symbol.infer_shape(**input_shapes)
File "/usr/local/lib/python2.7/dist-packages/mxnet/symbol.py", line 872, in infer_shape
res = self._infer_shape_impl(False, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mxnet/symbol.py", line 998, in _infer_shape_impl
ctypes.byref(complete)))
File "/usr/local/lib/python2.7/dist-packages/mxnet/base.py", line 84, in check_call
raise MXNetError(py_str(LIB.MXGetLastError()))
mxnet.base.MXNetError: Error in operator slicechannel0: [20:57:11] src/operator/./slice_channel-inl.h:198: Check failed: ishape[real_axis] == static_cast<size_t>(param
.num_outputs) (3000 vs. 30) If squeeze axis is True, the size of the sliced axis must be the same as num_outputs. Input shape=(100,3000), axis=1, num_outputs=30.

Stack trace returned 10 entries:
[bt] (0) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4dmlc15LogMessageFatalD1Ev+0x58) [0x3fff648bbc08]
[bt] (1) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(ZNK5mxnet2op16SliceChannelProp10InferShapeEPSt6vectorIN4nnvm6TShapeESaIS4_EES7_S7+0x65c) [0x3fff656ea52c]
[bt] (2) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x11cc178) [0x3fff653ac178]
[bt] (3) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(ZNSt17_Function_handlerIFbRKN4nnvm9NodeAttrsEPSt6vectorINS0_6TShapeESaIS5_EES8_EPS9_E9_M_invokeERKSt9_Any_dataS3_OS8_SF+0x34) [0x3fff648ada74]
[bt] (4) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x247e0c0) [0x3fff6665e0c0]
[bt] (5) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x247f78c) [0x3fff6665f78c]
[bt] (6) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(+0x248077c) [0x3fff6666077c]
[bt] (7) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4nnvm11ApplyPassesENS_5GraphERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x360) [0x3fff6668d380]
[bt] (8) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4nnvm9ApplyPassENS_5GraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x260) [0x3fff6579e4b0]
[bt] (9) /usr/local/lib/python2.7/dist-packages/mxnet/libmxnet.so(_ZN4nnvm4pass10InferShapeENS_5GraphESt6vectorINS_6TShapeESaIS3_EENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x210) [0x3fff657a3620]

@gongxijun
Copy link
Owner

hi,@white2007 do you bulid the mxnet ?

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

No branches or pull requests

2 participants