-
Notifications
You must be signed in to change notification settings - Fork 6.8k
predict-with-pretrained-model.ipynb unable to run #2718
Comments
@antinucleon The pull request #2585 actually breaks the behavior of the Pooling operations. Originally for I do advocate for this change. However, this behvior breaks the compatibility with existing models such as Inception-BN and many other Caffe models using 3x3/2 Pooling structures (e.g. GoogLeNet, ResNet). I think the ability to use existing pre-trained models is more important, so will the DMLC community revert this behavior back or provide a script to upgrade the models? |
I also suffer from the same issue. |
1 similar comment
I also suffer from the same issue. |
I will update the notebook. This is because we update pooling to standard pooling shape, which is different to old shape. |
@antinucleon Has this problem been fixed? I suffered the same problem when I use the pre-trained inception-bn model.
|
I believe the easiest way is to search in Inception_BN-symbol.json with "Pooling", and replace pad from (0,0) to (1,1) for those whose kernel is (3,3) and stride is (2,2). The following is a modified one:
|
@taoari Only need to modify -symbol.json ? What about .params ? Is it ok to run old .params with modified -symbol.json? |
@shesung To make it run, yes. Of course, it will no longer be compatible with the old model, but I think CNN is robust enough to tackle with these small variances for different pooling methods. |
@taori Thanks! I'll have a try. |
@shesung you meant to tell that to taoari ;) |
yeah, I noticed the only difference is code in the InceptionFactoryB
while the old version mxnet the code here, pad is not set (1, 1). |
Thanks, the "Incorrect shape" error fixed by adding pad=(1,1) in the InceptionFactoryB, and to search in Inception_BN-symbol.json with "Pooling", and replace pad from (0,0) to (1,1) for those whose kernel is (3,3) and stride is (2,2). |
Hello everyone, I had the same problem and did the correction using pad(0,0) to pad(1,1), everything works fine in the prediction except the fact that layer global_pool has a shape (1024L,2L,2L) instead of (1024L)... I don't understand why... |
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! |
I also meet the same error |
The notebook predict-with-pretrained-model.ipynb is no longer able to run correctly with the latest version. I am getting the following error:
The problem should be caused the change of the behavior of the pooling layer.
Originally, for an image of shape (32,32), with 3x3/2 pooling, it will generate an image of shape (16,16). But for current version, it generates an image of shape (15,15). Will you change this behavior back?
The text was updated successfully, but these errors were encountered: