# Caffe standalone Dockerfiles.
The `standalone` subfolder contains docker files for generating both CPU and GPU executable images for Caffe. The images can be built using make, or by running:
```
docker build -t caffe:cpu standalone/cpu
```
for example. (Here `gpu` can be substituted for `cpu`, but to keep the readme simple, only the `cpu` case will be discussed in detail).
Note that the GPU standalone requires a CUDA 7.5 capable driver to be installed on the system and [nvidia-docker] for running the Docker containers. Here it is generally sufficient to use `nvidia-docker` instead of `docker` in any of the commands mentioned.
# Running Caffe using the docker image
In order to test the Caffe image, run:
```
docker run -ti caffe:cpu caffe --version
```
which should show a message like:
```
libdc1394 error: Failed to initialize libdc1394
caffe version 1.0.0-rc3
```
One can also build and run the Caffe tests in the image using:
```
docker run -ti caffe:cpu bash -c "cd /opt/caffe/build; make runtest"
```
In order to get the most out of the caffe image, some more advanced `docker run` options could be used. For example, running:
```
docker run -ti --volume=$(pwd):/workspace caffe:cpu caffe train --solver=example_solver.prototxt
```
will train a network defined in the `example_solver.prototxt` file in the current directory (`$(pwd)` is maped to the container volume `/workspace` using the `--volume=` Docker flag).
Note that docker runs all commands as root by default, and thus any output files (e.g. snapshots) generated will be owned by the root user. In order to ensure that the current user is used instead, the following command can be used:
```
docker run -ti --volume=$(pwd):/workspace -u $(id -u):$(id -g) caffe:cpu caffe train --solver=example_solver.prototxt
```
where the `-u` Docker command line option runs the commands in the container as the specified user, and the shell command `id` is used to determine the user and group ID of the current user. Note that the Caffe docker images have `/workspace` defined as the default working directory. This can be overridden using the `--workdir=` Docker command line option.
# Other use-cases
Although running the `caffe` command in the docker containers as described above serves many purposes, the container can also be used for more interactive use cases. For example, specifying `bash` as the command instead of `caffe` yields a shell that can be used for interactive tasks. (Since the caffe build requirements are included in the container, this can also be used to build and run local versions of caffe).
Another use case is to run python scripts that depend on `caffe`'s Python modules. Using the `python` command instead of `bash` or `caffe` will allow this, and an interactive interpreter can be started by running:
```
docker run -ti caffe:cpu python
```
(`ipython` is also available in the container).
Since the `caffe/python` folder is also added to the path, the utility executable scripts defined there can also be used as executables. This includes `draw_net.py`, `classify.py`, and `detect.py`
没有合适的资源?快使用搜索试试~ 我知道了~
CVPR图像去阴影,毕业设计可运用,效果显著
共535个文件
cpp:178个
hpp:102个
cu:59个
需积分: 15 5 下载量 86 浏览量
2022-10-27
20:18:21
上传
评论
收藏 59.98MB ZIP 举报
温馨提示
CVPR图像去阴影,毕业设计可运用,效果显著
资源推荐
资源详情
资源评论
收起资源包目录
CVPR图像去阴影,毕业设计可运用,效果显著 (535个子文件)
matte_3_5_same.caffemodel 60.96MB
gtest_main.cc 2KB
caffe.cloc 1KB
Utils.cmake 13KB
Cuda.cmake 11KB
Summary.cmake 7KB
Targets.cmake 7KB
FindLAPACK.cmake 7KB
Dependencies.cmake 5KB
ConfigGen.cmake 4KB
ProtoBuf.cmake 4KB
FindMKL.cmake 3KB
FindNumPy.cmake 2KB
gflags.cmake 2KB
Misc.cmake 2KB
FindMatlabMex.cmake 2KB
FindLevelDB.cmake 2KB
glog.cmake 2KB
FindAtlas.cmake 2KB
FindOpenBLAS.cmake 2KB
FindGFlags.cmake 2KB
lint.cmake 1KB
FindGlog.cmake 1KB
FindvecLib.cmake 1KB
FindLMDB.cmake 1KB
FindSnappy.cmake 1KB
CNAME 25B
Makefile.config 4KB
gtest-all.cpp 329KB
test_net.cpp 75KB
test_upgrade_proto.cpp 71KB
test_pooling_layer.cpp 50KB
test_gradient_based_solver.cpp 44KB
test_convolution_layer.cpp 43KB
upgrade_proto.cpp 40KB
net.cpp 39KB
test_neuron_layer.cpp 34KB
test_split_layer.cpp 25KB
test_scale_layer.cpp 21KB
caffe_.cpp 21KB
test_bias_layer.cpp 19KB
data_transformer.cpp 18KB
solver.cpp 17KB
test_random_number_generator.cpp 17KB
window_data_layer.cpp 17KB
test_lrn_layer.cpp 17KB
base_conv_layer.cpp 16KB
test_inner_product_layer.cpp 15KB
test_data_layer.cpp 15KB
_caffe.cpp 14KB
blob.cpp 14KB
test_io.cpp 13KB
caffe.cpp 13KB
parallel.cpp 13KB
sgd_solver.cpp 12KB
test_deconvolution_layer.cpp 12KB
test_accuracy_layer.cpp 11KB
pooling_layer.cpp 11KB
test_memory_data_layer.cpp 11KB
test_data_transformer.cpp 11KB
lrn_layer.cpp 11KB
common.cpp 10KB
test_crop_layer.cpp 10KB
test_argmax_layer.cpp 10KB
math_functions.cpp 10KB
cudnn_conv_layer.cpp 10KB
test_reshape_layer.cpp 10KB
test_blob.cpp 9KB
test_reduction_layer.cpp 9KB
batch_norm_layer.cpp 9KB
im2col.cpp 9KB
scale_layer.cpp 9KB
layer_factory.cpp 9KB
im2col_layer.cpp 8KB
test_slice_layer.cpp 8KB
test_eltwise_layer.cpp 8KB
spp_layer.cpp 8KB
test_concat_layer.cpp 8KB
test_dummy_data_layer.cpp 7KB
io.cpp 7KB
test_filler.cpp 7KB
test_embed_layer.cpp 7KB
test_image_data_layer.cpp 7KB
test_math_functions.cpp 6KB
image_data_layer.cpp 6KB
extract_features.cpp 6KB
hdf5.cpp 6KB
test_im2col_layer.cpp 6KB
test_stochastic_pooling.cpp 6KB
softmax_loss_layer.cpp 6KB
hdf5_data_layer.cpp 6KB
test_tile_layer.cpp 5KB
inner_product_layer.cpp 5KB
eltwise_layer.cpp 5KB
test_mvn_layer.cpp 5KB
test_contrastive_loss_layer.cpp 5KB
crop_layer.cpp 5KB
test_power_layer.cpp 5KB
test_softmax_layer.cpp 5KB
insert_splits.cpp 5KB
共 535 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
阿利同学
- 粉丝: 3w+
- 资源: 290
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功