{"action":"opened","issue":{"url":"https://api.github.com/repos/vlfeat/matconvnet/issues/296","labels_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/296/comments","events_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/296/events","html_url":"https://github.com/vlfeat/matconvnet/issues/296","id":113085148,"number":296,"title":"Wrong net.normalization.border in pretrained models","user":{"login":"mfigurnov","id":11041610,"avatar_url":"https://avatars.githubusercontent.com/u/11041610?v=3","gravatar_id":"","url":"https://api.github.com/users/mfigurnov","html_url":"https://github.com/mfigurnov","followers_url":"https://api.github.com/users/mfigurnov/followers","following_url":"https://api.github.com/users/mfigurnov/following{/other_user}","gists_url":"https://api.github.com/users/mfigurnov/gists{/gist_id}","starred_url":"https://api.github.com/users/mfigurnov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfigurnov/subscriptions","organizations_url":"https://api.github.com/users/mfigurnov/orgs","repos_url":"https://api.github.com/users/mfigurnov/repos","events_url":"https://api.github.com/users/mfigurnov/events{/privacy}","received_events_url":"https://api.github.com/users/mfigurnov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-23T19:30:39Z","updated_at":"2015-10-23T19:30:39Z","closed_at":null,"body":"I've encountered a very strange behavior of `cnn_imagenet_evaluate`: in old versions of MatConvNet (March 2015 or so), VGG-16 model achieves 11.6% err5, while in new versions of MatConvNet the *same* model achieves 10.1% err5. Some investigation showed that multiple pretrained models, including but not limited to VGG-16, VGG-19 and VGG-F have incorrect `net.normalization.border`. It is set to [0 0], while in fact it should be [32 32]. This results in input images being resized (prior to cropping) so that the smaller dimension is 224, instead of 256. In April 2015 this issue was obscured by commit https://github.com/vlfeat/matconvnet/commit/58ba8b008cd789d3369e02b10fbf75943ff89631 which added the following line to cnn_imagenet_evaluate:\r\n```\r\nnet.normalization.border = [256 256] - net.normalization.imageSize(1:2) ;\r\n```\r\nSince that commit, `cnn_imagenet_evaluate` works correctly, while any other code using the same pretrained models achieves inferior results. I think this is a very confusing behavior. IMO, the `net.normalization.border` field of the pretrained models should be patched, and the offending line from `cnn_imagenet_evaluate` should be removed."}}