docker--caffe
Running an official image
You can run one of the automatic builds. E.g. for the CPU version:
docker run -ti bvlc/caffe:cpu caffe --version
or for GPU support (You need a CUDA 8.0 capable driver and nvidia-docker):
nvidia-docker run -ti bvlc/caffe:gpu caffe --version
You might see an error about libdc1394, ignore it.
Docker run options
By default caffe runs as root, thus any output files, e.g. snapshots, will be owned by root. It also runs by default in a container-private folder.
You can change this using flags, like user (-u), current directory, and volumes (-w and -v). E.g. this behaves like the usual caffe executable:
docker run --rm -u $(id -u):$(id -g) -v $(pwd):$(pwd) -w $(pwd) bvlc/caffe:cpu caffe train --solver=example_solver.prototxt
Containers can also be used interactively, specifying e.g. bash
or ipython
instead of caffe
.
docker run -ti bvlc/caffe:cpu ipython
import caffe
...
The caffe build requirements are included in the container, so this can be used to build and run custom versions of caffe. Also, caffe/python
is in PATH, so python utilities can be used directly, e.g. draw_net.py
, classify.py
, or detect.py
.
Building images yourself
Examples:
docker build -t caffe:cpu cpu
docker build -t caffe:gpu gpu
You can also build Caffe and run the tests in the image:
docker run -ti caffe:cpu bash -c "cd /opt/caffe/build; make runtest"
每一个不曾起舞的日子,都是对生命的辜负。
But it is the same with man as with the tree. The more he seeks to rise into the height and light, the more vigorously do his roots struggle earthward, downward, into the dark, the deep - into evil.
其实人跟树是一样的,越是向往高处的阳光,它的根就越要伸向黑暗的地底。----尼采
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步