Building environmental references
http://blog.csdn.net/ubunfans/article/details/47724341
This tutorial is basically correct.
One thing to add is
Make All-j4
After that, a lot of *.bin files are generated below build/bin/to prove that the compilation was successful.
The following is the run Mnist, performed to create_mnist.sh this step of the time encountered a problem
:./create_mnist.sh:build/examples/mnist/convert_mnist_data.bin:not found
It's going to change the catalog.
Note: The new Caffe will need to be executed from the root directory, or you may encounter this error
[Email protected]:~/work/caffe-master$ cp examples/mnist/create_mnist.sh./[email protected]
Take a look at the official tutorials
CD $CAFFE _root. /data/mnist/get_mnist.sh. /examples/mnist/create_mnist.sh
Directly according to the official tutorial to configure forget
Http://caffe.berkeleyvision.org/gathered/examples/mnist.html
The end is the official own data test, get a 99% accuracy, and then the end (a lot of blogs also ended), it's done! #$%%%%*& what the FU*K!!!!
Don't use your own data to test it??
Well, I'm going to renew my life ....
You can use Python, or you can call Classification.bin in C + +
If you do not move the usage, direct
./build/examples/cpp_classification/classification.bin
will prompt you to use the method's
Python:
Import OS import sys import numpy asNP Import Matplotlib.pyplot asPLT Caffe_root='/home/vr/documents/caffe/setup/caffe-master/'Sys.path.insert (0, Caffe_root +'python') Import Caffe Model_file='/home/vr/documents/caffe/setup/caffe-master/examples/mnist/lenet.prototxt'pretrained='/home/vr/documents/caffe/setup/caffe-master/examples/mnist/lenet_iter_10000.caffemodel'image_file='/home/vr/documents/caffe/setup/caffe-master/examples/mnist/test/0012.jpg'Input_image=caffe.io.load_image (image_file,color=False) #print input_image net=Caffe. Classifier (Model_file, pretrained) prediction=net.predict ([input_image]) caffe.set_mode_cpu () print'predicted class:', prediction[0].argmax ()
. sh Script Call
./build/examples/cpp_classification/classification.bin examples/mnist/classificat_net.prototxt Examples/mnist/lenet_iter_10000.caffemodel examples/mnist/mean.binaryproto examples/mnist/ Label.txt examples/mnist/0. png
What the??? Too many parameters?
Yes, change classification directly. CPP file
Recompile classification. bin
Encountered a new problem, the implementation of Classification.bin when the library is not found! So library!
(not finished, to be continued)
Caffe Linux The following debugging Mnist encountered the problem