Ubuntu 14.04 64位机上用Caffe+MNIST训练Lenet网络操作步骤
1.??????將終端定位到Caffe根目錄;
2.??????下載MNIST數據庫并解壓縮:$ ./data/mnist/get_mnist.sh
3.??????將其轉換成Lmdb數據庫格式:$ ./examples/mnist/create_mnist.sh?
執行完此shell腳本后,會在./examples/mnist下增加兩個新目錄,mnist_test_lmdb和mnist_train_lmdb
4.??????train model:$ ./examples/mnist/train_lenet.sh
(1)、使用LeNet網絡(《Gradient-BasedLearning Applied to Document Recognition》);
(2)、使用./examples/mnist/lenet_train_test.prototxtmodel;
(3)、使用./examples/mnist/lenet_solver.prototxtmodel;
(4)、執行train_lenet.sh腳本,會調用./build/tools目錄下的caffe執行文件,此執行文件的實現是./tools目錄下的caffe.cpp文件;
(5)、執行此腳本后,會生成幾個文件,其中./examples/mnist/lenet_iter_10000.caffemodel則是最終訓練生成的model文件;
(6)、以上默認的是在GPU模式下運行,如果想讓其在CPU模式下運行,只需將lenet_solver.prototxt文件中的solver_mode字段值由原來的GPU改為CPU即可;
運行結果如下圖:
參考文獻:http://caffe.berkeleyvision.org/gathered/examples/mnist.html
總結
以上是生活随笔為你收集整理的Ubuntu 14.04 64位机上用Caffe+MNIST训练Lenet网络操作步骤的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MNIST数据库介绍及转换
- 下一篇: Windows Caffe中MNIST数