gluon-reid icon indicating copy to clipboard operation
gluon-reid copied to clipboard

issues with branch folder

Open blue-butterfly opened this issue 6 years ago • 4 comments

hi,thanks for sharing,but I do not get the results with the code in branch folder,it get an error at the extract_feature function in test code。

blue-butterfly avatar Oct 09 '18 12:10 blue-butterfly

I get the results,thanks!!!

blue-butterfly avatar Oct 10 '18 03:10 blue-butterfly

@blue-butterfly Hello, I do not get the results with the code in branch folder,it get an error at the extract_feature function in test code,could you please tell me how to fix it? Thank you so much!

File "test.py", line 116, in test_feature = extract_feature(model, test_loader, context) File "test.py", line 60, in extract_feature f = nd.concat(model(img.as_in_context(ctx)[0]), axis=1).as_in_context(mx.cpu()).asnumpy() File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/block.py", line 542, in call out = self.forward(*args) File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/block.py", line 919, in forward return self.hybrid_forward(ndarray, x, *args, **params) File "~/person_reid/gluon-reid/branch/networks/resnet.py", line 123, in hybrid_forward x = self.base(x) File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/block.py", line 542, in call out = self.forward(*args) File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/block.py", line 919, in forward return self.hybrid_forward(ndarray, x, *args, **params) File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/nn/basic_layers.py", line 117, in hybrid_forward x = block(x) File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/block.py", line 542, in call out = self.forward(*args) File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/block.py", line 919, in forward return self.hybrid_forward(ndarray, x, *args, **params) File "~/person_reid/lib/python3.6/site-packages/mxnet/gluon/nn/conv_layers.py", line 133, in hybrid_forward act = getattr(F, self._op_name)(x, weight, name='fwd', **self._kwargs) File "", line 167, in Convolution File "~/person_reid/lib/python3.6/site-packages/mxnet/_ctypes/ndarray.py", line 92, in _imperative_invoke ctypes.byref(out_stypes))) File "~/person_reid/lib/python3.6/site-packages/mxnet/base.py", line 251, in check_call raise MXNetError(py_str(_LIB.MXGetLastError())) mxnet.base.MXNetError: [10:42:11] src/operator/nn/convolution.cc:145: Check failed: dshp.ndim() == 4U (3 vs. 4) Input data should be 4D in batch-num_filter-y-x

WangweiDamon avatar Dec 28 '18 02:12 WangweiDamon

@WangweiDamon hi, you can try : f = nd.concatenate(model(img.as_in_context(ctx)[0]), axis=1).as_in_context(mx.cpu()).asnumpy() -----> f = nd.concatenate(model(img.as_in_context(ctx))[0], axis=1).as_in_context(mx.cpu()).asnumpy() ,That's ok.

blue-butterfly avatar Jan 02 '19 10:01 blue-butterfly

@blue-butterfly Thank you so much for your help, the problem is solved.

WangweiDamon avatar Jan 02 '19 11:01 WangweiDamon