Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: viewing cifar-10 prediction #281

Closed
ghost opened this issue Apr 1, 2014 · 4 comments
Closed

question: viewing cifar-10 prediction #281

ghost opened this issue Apr 1, 2014 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 1, 2014

Hi,

I was trying to train caffe with cifar-10 image sets and tested it on another 32x32 image batch. I was able to run the testing, however, I could only see the accuracy, but not the actual top predictions.

I think the prediction results should be hidden somewhere but I had a hard time tracing through the code to find out how to print them, and didn't seem to able to find any documentation about it. Would anyone have an idea how? Thanks in advance!

@shelhamer shelhamer changed the title question: viewing cifar-10 predection question: viewing cifar-10 prediction Apr 2, 2014
@shelhamer
Copy link
Member

The output blob, which is the last blob, is a list of class probabilities from the softmax layer output. in C++ the output blobs are returned by Forward() or you can retrieve the vector of all blobs by

const vector<shared_ptr<Blob<float> > >& blobs = caffe_net->blobs();

after a call to Forward().

Alternatively you can run the net through the python wrapper and access the output class probability vector by net.blobs['prob']. Further python wrapper docs are coming soon.

@ghost
Copy link
Author

ghost commented Apr 4, 2014

Thanks for your reply!

I am a bit confused at the blob structure, could you please point me to some documentation? I am not too sure where it stores the class probability list...would it be in cpu_diff or gpu_diff or cpu_data?

I assume it would be on cpu_data, and it prints a set of possibilities for each class.. would this correspond to each mini-batch test cases? How may I get the possibility for every single image?

@shelhamer
Copy link
Member

See the new python interface classification example and #391.

I assume it would be on cpu_data, and it prints a set of possibilities for each class

Right–the Caffe reference ImageNet model output blob is named "prob" and this blob holds an N x K x 1 x 1 array where N is the minibatch size and K is the number of classes (1000). Each 1000-vector is the softmax output of class probabilities. for a given image input.

@adityaraj52
Copy link

I have added the the cifar10 prediction files to my git repository. You can follow this tutorial using read me to download required files to suit the changes:

https://github.com/adityaraj52/ConvNet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants