歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> Ubuntu15.04 運行caffe+mnist的demo

Ubuntu15.04 運行caffe+mnist的demo

日期:2017/3/3 12:55:05   编辑:Linux技術

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. 訓練模型:$ ./examples/mnist/train_lenet.sh

a、調用LeNet網絡

b、調用./examples/mnist/lenet_train_test.prototxt模型;

c、調用./examples/mnist/lenet_solver.prototxt模型;

配置文件中GLOG_logtostderr=1設置打印所有日志消息;train_net.bin訓練腳本

d、執行train_lenet.sh腳本,直接調用./build/tools目錄下的caffe執行文件,此執行文件的實現是./tools目錄下的caffe.cpp文件;

e、執行此腳本後,會生成幾個文件,其中./examples/mnist/lenet_iter_10000.caffemodel則是最終訓練生成的model文件;

note:在lenet_solver.prototxt文件中的solver_mode字段值由的GPU和CPU更換即可在不同條件下運行

Copyright © Linux教程網 All Rights Reserved