Skip to content

Conversation

@ronghanghu
Copy link
Member

This PR addresses #2505 (comment)

In MatCaffe, there are currently two (conflicting) ways to load mean:

  • caffe/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat, which is inherited from old wrapper, contains image_mean variable in height x width x 3, BGR channels. This is inconsistent with the way caffe stores data (WxHxCxN in Matlab).
  • caffe.io.read_mean('./data/ilsvrc12/imagenet_mean.binaryproto'), which is also inherited from old wrapper, returns mean_data in width x height x 3 (also BGR channels), which is consistent with the way a caffe's blob stores data.

The inconsistency in ilsvrc_2012_mean.mat is very likely to confuse users when doing mean subtraction. Although this issue also existed in the old Matlab wrapper, it should be addressed somehow.

So this PR permute height and width in caffe/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat, use a new variable name mean_data instead of image_mean in that file, and update classification_demo.m. Also, some comments are added in classification_demo.m and io.m (and also handle grayscale images).

@ronghanghu ronghanghu mentioned this pull request May 30, 2015
@ronghanghu ronghanghu force-pushed the matcaffe-update-mean-format branch 2 times, most recently from 0d2682b to a399dea Compare May 30, 2015 02:46
@ronghanghu
Copy link
Member Author

It seems that travis install failed

~/build/BVLC/caffe ~/build/BVLC/caffe
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:02:06 --:--:--     0curl: (7) couldn't connect to host
The command "sudo -E $SCRIPTS/travis_install.sh" failed and exited with 7 during .
Your build has been stopped.

It seems that travis failed to download http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_6.5-14_amd64.deb
ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.39.tgz
Not sure why it happened. Trying to resolve..

@ronghanghu ronghanghu force-pushed the matcaffe-update-mean-format branch from a399dea to cb3cb25 Compare May 30, 2015 03:01
@shelhamer shelhamer closed this May 30, 2015
@shelhamer shelhamer reopened this May 30, 2015
@shelhamer
Copy link
Member

@ronghanghu it was probably a passing network issue. I just toggled the PR to re-trigger the tests -- not that this PR should change the results anyway.

@ronghanghu
Copy link
Member Author

@shelhamer But I cannot download the LMDB in travis_install.sh either from my laptop or kraken machine.

$ curl ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.39.tgz
curl: (7) Failed to connect to 2600:3c01::f03c:91ff:fedb:ad59: Network is unreachable

There seems to be something wrong with it. Maybe http://www.openldap.org/ is under maintenance at this moment.

Update: the link above seems to have resurrected a few minutes ago

@ronghanghu ronghanghu force-pushed the matcaffe-update-mean-format branch from cb3cb25 to fd4ab97 Compare May 30, 2015 04:47
@jeffdonahue jeffdonahue mentioned this pull request May 30, 2015
Update previously ilsvrc_2012_mean.mat stores 'image_mean' variable in
H x W x C with BGR channels, which is inconsistent with Caffe's data format
and inconsistent with caffe.io.read_mean(..). Replace 'image_mean' with
'mean_data' variable in W x H x C and update classification_demo.m. Also add
some comments.
@ronghanghu ronghanghu force-pushed the matcaffe-update-mean-format branch from fd4ab97 to 97b4c14 Compare May 30, 2015 06:28
shelhamer added a commit that referenced this pull request May 30, 2015
switch ilsvrc_2012_mean.mat to W x H x C, update demo and add comments
@shelhamer shelhamer merged commit f37bfbf into BVLC:master May 30, 2015
@ronghanghu ronghanghu deleted the matcaffe-update-mean-format branch May 30, 2015 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants