Ubuntu 14.04 64位機上用Caffe+MNIST訓練Lenet網路操作步驟

來源:互聯網
上載者:User

Ubuntu 14.04 64位機上用Caffe+MNIST訓練Lenet網路操作步驟

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.