2 title: "Installation: Debian"
7 Caffe packages are available for `Debian/unstable`. Debian/stable
8 (jessie) users should take a look at [Ubuntu installation instruction](
9 install_apt.html). Debian/testing (stretch) users may be able to get Caffe
10 to work using the packages in Debian/unstable, but it is beyond the scope of
13 Only experienced linux users are recommended to try Debian/unstable (Sid).
15 Last update: Dec.21 2016
19 Apart from the installation methods based on source, Debian/unstable
20 users can install pre-compiled Caffe packages via the official archive.
22 ### Binary installation
24 Make sure that there is something like the follows in your `/etc/apt/sources.list`:
26 deb http://ftp2.cn.debian.org/debian sid main contrib non-free
28 Then we update APT cache and directly install Caffe. Note, the cpu version and
29 the cuda version cannot be installed at the same time.
32 # apt install [ caffe-cpu | caffe-cuda ]
34 It should work out of box.
36 #### Customizing caffe packages
38 Some users may need to customize the Caffe package. Here is a brief
39 guide of producing the customized `.deb` packages.
41 Make sure that there is something like this in your `/etc/apt/sources.list`:
43 deb http://ftp2.cn.debian.org/debian sid main contrib non-free
44 deb-src http://ftp2.cn.debian.org/debian sid main contrib non-free
47 Then we build caffe deb files with the following commands:
50 $ sudo apt install build-essential debhelper devscripts # standard package building tools
51 $ sudo apt build-dep [ caffe-cpu | caffe-cuda ] # the most elegant way to pull caffe build dependencies
52 $ apt source [ caffe-cpu | caffe-cuda ] # download the source tarball and extract
54 [ ... optional, customize caffe code/build ... ]
55 $ debuild -B -j4 # build caffe with 4 parallel jobs (similar to make -j4)
57 $ debc # optional, if you want to check the package contents
58 $ sudo debi # optional, install the generated packages
60 The resulting deb packages can be found under the parent directory of the source tree.
62 ### Source installation
64 Source installation under Debian/unstable is similar to that of Ubuntu, but
65 here is a more elegant way to pull caffe build dependencies:
67 $ sudo apt build-dep [ caffe-cpu | caffe-cuda ]
69 Note, this requires a `deb-src` entry in your `/etc/apt/sources.list`.
73 * Consider re-compiling OpenBLAS locally with optimization flags for sake of
74 performance. This is highly recommended if you are writing a paper.
76 * If you are installing `caffe-cuda`, APT will automatically pull some of the
77 CUDA packages and the nvidia driver packages. Please take care if you have
78 manually installed or hacked nvidia driver or CUDA toolkit or any other
79 related stuff, because in this case it may fail.
81 * If you encountered any problem when installing `caffe-*`, please report bug
82 to Debian via Debian's bug tracking system. See https://www.debian.org/Bugs/ .
84 * Additionally, a manpage (`man caffe`) and a bash complementation script
85 (`caffe <TAB><TAB>`, `caffe train <TAB><TAB>`) are provided.
86 Both of the two files are still not merged into caffe master.
88 * The python interface is Python 3 version: `python3-caffe-{cpu,cuda}`.
89 No plan to support python2.
93 * where is caffe-cudnn?
95 CUDNN library seems not redistributable currently. If you really want the
96 caffe-cudnn deb packages, the workaround is to install cudnn by yourself,
97 and hack the packaging scripts, then build your customized package.
99 * I installed the CPU version, How can I switch to the CUDA version?
101 `sudo apt install caffe-cuda`, apt's dependency resolver is smart enough to deal with this.
103 * Where is the examples, the models and other documentation stuff?
106 sudo apt install caffe-doc