Welcome 微信登录

首页 / 操作系统 / Linux / Ubuntu 14.04 64位机上用Caffe+MNIST训练Lenet网络操作步骤

Ubuntu 14.04 64位机上用Caffe+MNIST训练Lenet网络操作步骤1.将终端定位到Caffe根目录;2.下载MNIST数据库并解压缩:$ ./data/mnist/get_mnist.sh3.将其转换成Lmdb数据库格式:$ ./examples/mnist/create_mnist.sh执行完此shell脚本后,会在./examples/mnist下增加两个新目录,mnist_test_lmdb和mnist_train_lmdb4.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相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2本文永久更新链接地址