-
Notifications
You must be signed in to change notification settings - Fork 6.8k
error of "Incorrect shape" in example/cpp/image-classification-predict.cc #2709
Comments
I met the error too.You can change your data_shape's value to solve it. What is your data_shape's value? |
Hi @stardust, thanks for your support.
|
I think this is caused by the pooling behavior with 3x3/2 structures. This affects the CaffeNet, GoogleNet, Inception-BN models, but you can try VGG16, or ResNet50. They work good. I did not notice this issue, and opened another similar issue #2718 , I think the reasons are the same. Hope that people will quickly fix this soon. Or you can revert to the version tagged |
@taoari, thanks. Will try and report soon.
|
Hi @taoari, same error for inception_bn at mxnet-20160531 + 20160713's sub-modules (dmlc-core, ps-lite, ms-shadow). Will check with VGG16, or ResNet50 |
@weishengchong In my case, it works. See #2718 for my description. It is this PR #2585 that changes the behavior. When I revert to one commit before that PR, it also works well. I am not using the C++ file image-classification-predict.cc, you can use the notebook predict-with-pretrained-model.ipynb for a quick check. |
I confirmed image-classification-predict.cc + inception_v3 works good using model below |
@weishengchong Maybe, but Inception_BN does not work. I did not try Inception-V3 yet. 3x3/2 pooling behavior is changed, it does not mean that models using 3x3/2 will not work. For example, ResNet50 will behave like 112->55->28, while in He's paper it should work like 112->56->28. But ResNet50 still runs, and the final results might slightly different. I am not sure to what degree it will hurts the final accuracy. |
What about using the 3x3/2 pooling with pad=1? Pre-trained models may still degrade in accuracy though. There seems an offset of one pixel between this implementation and the previous. |
This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks! |
prediction using image-classification-predict.cc return error below for my input 224x224 color image, which complies with size setting in image-classification-predict.cc. Please kindly advise.
[src/c_api/c_predict_api.cc]MXPredCreatePartialOut(177):CHECK
[00:17:33] /N/software/mxnet/mxnet-master/dmlc-core/include/dmlc/logging.h:235: [00:17:33] src/operator/./concat-inl.h:152: Check failed: (dshape[j]) == (tmp[j]) Incorrect shape[2]: (1,320,15,15). (first input shape: (1,576,14,14)
Thanks!
The text was updated successfully, but these errors were encountered: