[caffe with docker][01] train demo, the mnist dataset

本文详细介绍了如何利用Docker快速安装并配置Caffe环境,包括安装基本要求、获取并运行Caffe镜像、安装Vim编辑器、下载MNIST数据集、创建数据库、训练模型等步骤。

Hi, every one, here will be a series for record my learning process of caffe with docker. The reason why using docker, not with a bare metal like linux or windows, is just cuz the installation is too hard for me, a noob.

1. basic requirements

  • linux with docker, if you don’t know how to install docker on your linux, check my previous blog here.
  • skilled in docker
  • a little knowledges about shell

2. get and run caffe image

official installation weblink is http://caffe.berkeleyvision.org/installation.html, here is the shell command.

docker pull bvlc/caffe:cpu
docker run -it -d bvlc/caffe:cpu /bin/bash

这里写图片描述
then we can go into the container

docker exec -it ba1 /bin/bash

the default WORKDIR is /workspace, we should cd /opt/caffe, the rectangled zone is important in the next.
这里写图片描述

3. install vim in docker

we need to edit the files in it, so we need to install vim with apt-get install vim, and then edit the file ~/.vimrc, add one line syntax on in it is enough.

4. download the mnist dataset

./data/mnist/get_mnist.sh

这里写图片描述

5. create database

./examples/mnist/create_mnist.sh

这里写图片描述

6. train it

./examples/mnist/train_lenet.sh

saddly, we got en error, cuz we didn’t change the mode.
这里写图片描述
change the mode in file vi examples/mnist/lenet_solver.prototxt
这里写图片描述
then we rerun the command ./examples/mnist/train_lenet.sh, we can see, the training is started! and the process will be printed every 100 loops.
这里写图片描述
这里写图片描述

over, here we just need to wait for it, and then a caffemodel will be generated. we’ll learn how to use the model in next article.


after go out for about half an hour running, the training ended. some models generated.
这里写图片描述

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值