兵马逐浪去,将象入海流。炮声震心动,惊起卧龙游。
我的博客园主页 --------- 我的知乎主页 --------- 我的github主页 --------- 我的csdn主页 --------- 我的新浪微博

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.pyclassify.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"

posted @   leoking01  阅读(411)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话
#back-to-top { background-color: #00CD00; bottom: 0; box-shadow: 0 0 6px #00CD00; color: #444444; padding: 10px 10px; position: fixed; right: 50px; cursor: pointer; }
点击右上角即可分享
微信分享提示