Add MNIST support to classify.py script #735
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For a beginner's guide to Caffe I'm working on, I need a simple way for newbies to train their own network, and then try it out for themselves. The MNIST documentation is great for the training part, but the python scripts for running forward prediction on images were missing a couple of features I needed:
To test that it didn't break the existing Imagenet functionality, I've been running this command:
python python/classify.py --print_results examples/images/cat.jpg foo
The results continue to be the expected 'kit fox' label.
Running an MNIST network created from the tutorial against a sample image is done with the command line:
python python/classify.py --print_results --model_def examples/mnist/lenet.prototxt --pretrained_model examples/mnist/lenet_iter_10000 --force_grayscale --center_only --labels_file data/mnist/mnist_words.txt --images_dim 28,28 data/mnist/sample_2.png foo
I think it would be a big help to new users if they could quickly try out networks and see results, so I hope this makes it in.