[caffe] 01/01: README.Debian: update

Zhou Mo cdluminate-guest at moszumanska.debian.org
Wed May 18 10:21:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

cdluminate-guest pushed a commit to branch master
in repository caffe.

commit 1e855ea6c96a5f795cfa4f52c03b792bad7ca187
Author: Zhou Mo <cdluminate at gmail.com>
Date:   Wed May 18 10:21:05 2016 +0000

    README.Debian: update
---
 debian/README.Debian | 169 +++++++++++++++++++++++++++------------------------
 1 file changed, 90 insertions(+), 79 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index 8e350be..d72ab07 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -1,128 +1,139 @@
-                   Caffe for Debian
-                   ================
 
- In short, package "Caffe" for Debian is compiled as 2 sets of packages,
- but the two sets are not co-installable. [1]
+                Caffe Package Manual for Debian
 
-  + Caffe-CPU: (configured as CPU_ONLY)
+                            Zhou Mo
+                      cdluminate at gmail.com
 
-    * caffe-cpu          -- command line utilities
-    * libcaffe-cpu*      -- core library
-    * libcaffe-cpu-dev   -- development files
-    * python-caffe-cpu   -- python2 interface
+                   Last update: May. 18 2016
 
-    Source package of this set is "caffe", in the main section.
- 
-  + Caffe-CUDA: (compiled with CUDA)
+Package Scheme
+--------------
 
-    * caffe-cuda
-    * libcaffe-cuda*
-    * libcaffe-cuda-dev
-    * python-caffe-cuda
+Caffe supports 2 modes: CPU_ONLY mode and CUDA mode, and actually the
+caffe configureed in CUDA mode can run in CPU_ONLY mode. So providing
+two sets of Caffe packages, with the CPU_ONLY one in main/science
+section and the CUDA one in contrib/science section. Users need to
+choose a set of packages to install.
 
-    Source package of this set is "caffe-contrib", in the contrib section.
+ * source package "caffe" compiles the CPU_ONLY set.
+ * source package "caffe-contrib" compiles the CUDA set.
 
- Happy Deep Learning ! :-)
+Both of the sources are hosted on Alioth, debian-science.
+Here is what binary package can be built from the sources:
 
+ * CPU_ONLY set from source "caffe"
+   - caffe-cpu          -- command line utilities
+   - libcaffe-cpu*      -- core library
+   - libcaffe-cpu-dev   -- development files
+   - python-caffe-cpu   -- python2 interface
 
-                   Custom Build of Caffe
-                   =====================
+ * CUDA set from source "caffe-contrib"
+   - caffe-cuda
+   - libcaffe-cuda*
+   - libcaffe-cuda-dev
+   - python-caffe-cuda
 
- Compiling caffe locally may potentially bring a better machine
- performance. Inspired by Debian's OpenBLAS packaging, I provid
- custom targets for users to build customized caffe Packages for
- local use:
+Just choose one and enjoy Deep Learning, then good luck in
+tweaking parameters and writing papers!
 
-  * custom-cpu   <--> source: "caffe"
-  * custom-cuda  <--> source: "caffe-contrib"
 
- Following is instruction for doing such a custom build:
+Why do We Link Caffe Against libblas.so.3 ?
+-------------------------------------------
 
-  1. Install Build-Dependencies, including Debian packaging utils.
+Well this is neither accidental nor awkward. This is due to a
+Debian feature called `alternatives`.
 
-     * Packaging helpers:
+`libblas.so.3` is a symbol link, you can make it point to
+either `atlas` or `openblas` without rebuilding Caffe.
 
-        $ apt install build-essential debhelper devscripts
+See what's your current selection of libblas.so.3 :
 
-     * Build-Dependencies:
+  $ sudo update-alternatives --get-selections | grep libblas
 
-        $ apt-get build-dep caffe
+If you want to switch the BLAS lib from basic BLAS library
+to atlas or openblas, first install your favorate one
 
-    Or install build-dependencies manually, the dependency information
-    is stored at the top part of `debian/control`.
+  $ sudo apt install libopenblas-dev
+  OR $ sudo apt install libatlas-dev
 
-  2. [Optional] Read the configuration template at the top part of
-     debian/rules, then have a look at the bottom part of this file. 
-     Tweak some options as long as you need. (`debian/rules` is a Makefile)
-     Here are some hints:
+then update the alternatives:
+
+  $ sudo update-alternatives --config libblas.so.3
+  $ sudo update-alternatives --config libblas.so
+
+Finally you run Caffe again. Is it faster as you expected?
 
-     * CUSTOM_JOBS   := "-j5"
 
-       Parallel compiling jobs, i.e. make -j5
+Custom Build of Caffe
+---------------------
 
-     * CONFFLAG_CPU_CUSTOM = ...
+How to compile these packages by myself?
 
-       Tweak this when you like to compile the caffe-cpu set,
-       and this variable stores cmake options.
+0. choose and download source package with `apt-get source <source>`,
+   available sources are "caffe" and "caffe-contrib".
 
-     * CONFFLAG_CUDA_CUSTOM = ...
+1. Install Build-Dependencies, including Debian packaging utils.
 
-       Tweak this when you like to compile the caffe-cuda set,
-       and this variable stores cmake options.
+   $ apt install build-essential debhelper devscripts
+   $ apt-get build-dep [caffe | caffe-contrib]
 
-  3. Choose a configuration and start compiling.
-     (make sure you are in the root of source tree)
+2. [Optional] Change CMAKE flags in debian/rules if you wish,
+   but there is no promise whether your customized build will pass.
+
+   You may want to change this flag, which is for the number of
+   parallel compiling jobs.
+
+     * CUSTOM_JOBS   := "-j5"
 
-     To compile caffe-cpu set:
+   If you are familiar with CMAKE and able to read debian/rules,
+   then this variable is left for you to hack.
 
-       $ debian/rules custom-cpu
+     * CONFFLAG_XXX_CUSTOM
 
-     To compile caffe-cuda set:
+   where XXX can be "CPU" or "CUDA".
 
-       $ debian/rules custom-cuda
+3. Start compiling, make sure you are in the root of source tree.
 
-     The default custom configuration is tested by me, however
-     there's no promise that the custom build will always work.
-     Suggestion is welcome :-)
+   Run this command for source "caffe":
+     $ debian/rules custom-cpu
 
-  4. Installing freshly cooked Caffe Packages
+   Run this command for source "caffe-contrib":
+     $ debian/rules custom-cuda
 
-     * Check the resulting packages
+4. Install the resulting .deb packages.
 
-        $ ls ../*.deb
+   * Check the resulting packages
+      $ ls ../*.deb
 
-     * If nothing went wrong, install them. [2]
+   * If nothing went wrong, install them. I recommend you
+     to first install the libcaffe package.
+      $ sudo dpkg -i libcaffe-*.deb
+      $ sudo dpkg -i <others>
 
-        $ sudo dpkg -i libcaffe-*.deb
-        $ sudo dpkg -i <others>
+5. Grab some datasets, set up your network and see if it works as
+   you expected. If you can't be lazier, run this script
 
-  5. Grab some datasets, set up your network and have fun.
+     $ debian/tests/caffe_simple_run
 
-                   Notes for Package Maintainer
-                   ============================
+   If it doesn't explode, then we can conclude that it works, at
+   least for Convolution layer, Pooling layer, InnerProduct layer,
+   ReLU layer and Softmax layer.
+
+
+Notes for Package Maintainer
+============================
 
 1. Testing whether the program works, apart from the test programs?
 
-     $ caffe time -model examples/mnist/lenet.prototxt
+   $ caffe time -model examples/mnist/lenet.prototxt
 
    or with gpu
 
-     $ caffe time -model examples/mnist/lenet.prototxt -gpu 0
+   $ caffe time -model examples/mnist/lenet.prototxt -gpu 0
 
    Well, testing caffe in this way (using deploy version of network)
    requires no dataset, which may be useful for some maintainers
    who are not familiar with Caffe.
 
-                   Footnotes
-                   =========
-
-[1] It's nonsence to install caffe-cpu and caffe-cuda together.
-    caffe-cuda can work under CPU_ONLY mode.
-
-[2] Make sure to firstly install libcaffe-* which includes libcaffe.so.*,
-    the shared object file of caffe, or you will get some error messages
-    from dpkg (dependency unsatisfied). However that would NOT be hurt
-    if you didn't follow.
-
-[A]
- -- Zhou Mo <cdluminate at gmail.com>  Sun, 16 Apr 2016 00:00:00 +0000
+   If you want to test Caffe on some real dataset, you can take
+   a closer look at `examples/mnist/readme.md`.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/caffe.git



More information about the debian-science-commits mailing list