Skip to content

Commit

Permalink
Update mean file help
Browse files Browse the repository at this point in the history
Numpy array dimensions should be [Channels x Height x Width], NOT [Height x Width x Channels]

If an image mean file is supplied with channels as the last dimension, classify.py throws errors like:

ValueError: operands could not be broadcast together with shapes (3,227,227) (256,0,225) (3,227,227)
  • Loading branch information
dgolden1 committed Dec 3, 2014
1 parent c67c8d1 commit a5b7b2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def main(argv):
"--mean_file",
default=os.path.join(pycaffe_dir,
'caffe/imagenet/ilsvrc_2012_mean.npy'),
help="Data set image mean of H x W x K dimensions (numpy array). " +
"Set to '' for no mean subtraction."
help="Data set image mean of [Channels x Height x Width] dimensions " +
"(numpy array). Set to '' for no mean subtraction."
)
parser.add_argument(
"--input_scale",
Expand Down

0 comments on commit a5b7b2d

Please sign in to comment.