在安裝好的 caffe 環境裡訓練模型時報錯
$ cd <caffe根目錄>
$ ./build/tools/caffe train -solver examples/mnist/lenet_solver.prototxt
...
I0111 15:27:57.013530 20030 layer_factory.hpp:77] Creating layer mnist
F0111 15:27:57.013805 20030 db_lmdb.hpp:15] Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
*** Check failure stack trace: ***
@ 0x7f4ca2072e6d (unknown)
@ 0x7f4ca2074ced (unknown)
@ 0x7f4ca2072a5c (unknown)
@ 0x7f4ca207563e (unknown)
@ 0x7f4ca2554321 caffe::db::LMDB::Open()
@ 0x7f4ca24639b4 caffe::DataLayer<>::DataLayer()
@ 0x7f4ca2463b62 caffe::Creator_DataLayer<>()
@ 0x7f4ca252a149 caffe::Net<>::Init()
@ 0x7f4ca252c322 caffe::Net<>::Net()
@ 0x7f4ca2533a30 caffe::Solver<>::InitTrainNet()
@ 0x7f4ca2534983 caffe::Solver<>::Init()
@ 0x7f4ca2534c5f caffe::Solver<>::Solver()
@ 0x7f4ca254bad1 caffe::Creator_SGDSolver<>()
@ 0x40ee8e caffe::SolverRegistry<>::CreateSolver()
@ 0x40812c train()
@ 0x405b8c main
@ 0x7f4c9c8ddb35 __libc_start_main
@ 0x40654b (unknown)
Aborted (core dumped)
複制
問題原因是沒有找到訓練用的資料,是以我們需要先下載下傳訓練資料,如下
$ cd <caffe根目錄>
$ ./data/mnist/get_mnist.sh
$ ./examples/mnist/create_mnist.sh
複制
然後重新運作訓練模型
$ cd <caffe根目錄>
$ ./build/tools/caffe train -solver examples/mnist/lenet_solver.prototxt
或
$ ./examples/mnist/train_lenet.sh
複制