提交 2ee40cb1 编写于 作者: G gineshidalgo99

Caffe updated to Aug20 version

上级 f83a6bbb
Unix:
- Caffe:
- Version 1.0.0, extracted from GitHub on 07/19/2017 from the current master branch.
- Version 1.0.0, extracted from GitHub on 08/20/2017 from the current master branch.
- Link: https://github.com/BVLC/caffe
Windows:
......
......@@ -17,7 +17,7 @@ and step-by-step examples.
## Custom distributions
- [Intel Caffe](https://github.com/BVLC/caffe/tree/intel) (Optimized for CPU and support for multi-node), in particular Xeon processors (HSW, BDW, Xeon Phi).
- [Intel Caffe](https://github.com/BVLC/caffe/tree/intel) (Optimized for CPU and support for multi-node), in particular Xeon processors (HSW, BDW, SKX, Xeon Phi).
- [OpenCL Caffe](https://github.com/BVLC/caffe/tree/opencl) e.g. for AMD or Intel devices.
- [Windows Caffe](https://github.com/BVLC/caffe/tree/windows)
......
......@@ -12,11 +12,12 @@ endif()
set(__veclib_include_suffix "Frameworks/vecLib.framework/Versions/Current/Headers")
exec_program(xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR)
find_path(vecLib_INCLUDE_DIR vecLib.h
DOC "vecLib include directory"
PATHS /System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
/System/Library/${__veclib_include_suffix}
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
NO_DEFAULT_PATH)
include(FindPackageHandleStandardArgs)
......
......@@ -4,6 +4,38 @@ title: "Installation: Ubuntu"
# Ubuntu Installation
### For Ubuntu (>= 17.04)
**Installing pre-compiled Caffe**
Everything including caffe itself is packaged in 17.04 and higher versions.
To install pre-compiled Caffe package, just do it by
sudo apt install caffe-cpu
for CPU-only version, or
sudo apt install caffe-cuda
for CUDA version. Note, the cuda version may break if your NVIDIA driver
and CUDA toolkit are not installed by APT.
[Package status of CPU-only version](https://launchpad.net/ubuntu/+source/caffe)
[Package status of CUDA version](https://launchpad.net/ubuntu/+source/caffe-contrib)
**Installing Caffe from source**
We may install the dependencies by merely one line
sudo apt build-dep caffe-cpu # dependencies for CPU-only version
sudo apt build-dep caffe-cuda # dependencies for CUDA version
It requires a `deb-src` line in your `sources.list`.
Continue with [compilation](installation.html#compilation).
### For Ubuntu (\< 17.04)
**General dependencies**
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
......
......@@ -8,24 +8,28 @@ Caffe packages are available for several Debian versions, as shown in the
following chart:
```
Your Distro | CPU_ONLY | CUDA | Alias
Your Distro | CPU_ONLY | CUDA | Codename
----------------+------------+--------+-------------------
Debian/stable | ✘ | ✘ | Debian Jessie
Debian/testing | ✔ | ✔ | Debian Stretch/Sid
Debian/unstable | ✔ | ✔ | Debian Sid
Debian/oldstable| ✘ | ✘ | Jessie (8.0)
Debian/stable | ✔ | ✔ | Stretch (9.0)
Debian/testing | ✔ | ✔ | Buster
Debian/unstable | ✔ | ✔ | Buster
```
* `✘ ` You should take a look at [Ubuntu installation instruction](install_apt.html).
* `✔ ` You can install caffe with a single command line following this guide.
Last update: 2017-02-01
* [Package status of CPU-only version](https://tracker.debian.org/pkg/caffe)
* [Package status of CUDA version](https://tracker.debian.org/pkg/caffe-contrib)
Last update: 2017-07-08
## Binary installation with APT
Apart from the installation methods based on source, Debian/unstable
and Debian/testing users can install pre-compiled Caffe packages from
the official archive.
Apart from the installation methods based on source, Debian users can install
pre-compiled Caffe packages from the official archive with APT.
Make sure that your `/etc/apt/sources.list` contains `contrib` and `non-free`
sections if you want to install the CUDA version, for instance:
......@@ -44,7 +48,8 @@ $ caffe # command line interface wo
$ python3 -c 'import caffe; print(caffe.__path__)' # python3 interface working
```
These Caffe packages should work for you out of box.
These Caffe packages should work for you out of box. However, the CUDA version
may break if your NVIDIA driver and CUDA toolkit are not installed with APT.
#### Customizing caffe packages
......@@ -96,18 +101,22 @@ Note, this requires a `deb-src` entry in your `/etc/apt/sources.list`.
Some users may find their favorate compiler doesn't work with CUDA.
```
CXX compiler | CUDA 7.5 | CUDA 8.0 |
-------------+------------+------------+-
GCC-7 | ? | ? |
GCC-6 | ✘ | ✘ |
GCC-5 | ✔ [1] | ✔ |
CLANG-4.0 | ? | ? |
CLANG-3.9 | ✘ | ✘ |
CLANG-3.8 | ? | ✔ |
CXX compiler | CUDA 7.5 | CUDA 8.0 | CUDA 9.0 |
-------------+------------+------------+------------+
GCC-8 | ? | ? | ? |
GCC-7 | ? | ? | ? |
GCC-6 | ✘ | ✘ | ✔ |
GCC-5 | ✔ [1] | ✔ | ✔ |
-------------+------------+------------+------------+
CLANG-4.0 | ? | ? | ? |
CLANG-3.9 | ✘ | ✘ | ✔ |
CLANG-3.8 | ? | ✔ | ✔ |
```
`[1]` CUDA 7.5 's `host_config.h` must be patched before working with GCC-5.
`[2]` CUDA 9.0: https://devblogs.nvidia.com/parallelforall/cuda-9-features-revealed/
BTW, please forget the GCC-4.X series, since its `libstdc++` ABI is not compatible with GCC-5's.
You may encounter failure linking GCC-4.X object files against GCC-5 libraries.
(See https://wiki.debian.org/GCC5 )
......@@ -152,10 +161,3 @@ and hack the packaging scripts, then build your customized package.
$ sudo apt install caffe-doc
$ dpkg -L caffe-doc
```
* Where can I find the Debian package status?
```
https://tracker.debian.org/pkg/caffe (for the CPU_ONLY version)
https://tracker.debian.org/pkg/caffe-contrib (for the CUDA version)
```
......@@ -14,7 +14,7 @@ title: Local Response Normalization (LRN)
- `local_size` [default 5]: the number of channels to sum over (for cross channel LRN) or the side length of the square region to sum over (for within channel LRN)
- `alpha` [default 1]: the scaling parameter (see below)
- `beta` [default 5]: the exponent (see below)
- `norm_region` [default `ACROSS_CHANNELS`]: whether to sum over adjacent channels (`ACROSS_CHANNELS`) or nearby spatial locaitons (`WITHIN_CHANNEL`)
- `norm_region` [default `ACROSS_CHANNELS`]: whether to sum over adjacent channels (`ACROSS_CHANNELS`) or nearby spatial locations (`WITHIN_CHANNEL`)
The local response normalization layer performs a kind of "lateral inhibition" by normalizing over local input regions. In `ACROSS_CHANNELS` mode, the local regions extend across nearby channels, but have no spatial extent (i.e., they have shape `local_size x 1 x 1`). In `WITHIN_CHANNEL` mode, the local regions extend spatially, but are in separate channels (i.e., they have shape `1 x local_size x local_size`). Each input value is divided by $$(1 + (\alpha/n) \sum_i x_i^2)^\beta$$, where $$n$$ is the size of each local region, and the sum is taken over the region centered at that value (zero padding is added where necessary).
......
......@@ -73,12 +73,12 @@
")\n",
"\n",
"# Split into train and test\n",
"X, Xt, y, yt = sklearn.cross_validation.train_test_split(X, y)\n",
"X, Xt, y, yt = sklearn.model_selection.train_test_split(X, y)\n",
"\n",
"# Visualize sample of the data\n",
"ind = np.random.permutation(X.shape[0])[:1000]\n",
"df = pd.DataFrame(X[ind])\n",
"_ = pd.scatter_matrix(df, figsize=(9, 9), diagonal='kde', marker='o', s=40, alpha=.4, c=y[ind])"
"_ = pd.plotting.scatter_matrix(df, figsize=(9, 9), diagonal='kde', marker='o', s=40, alpha=.4, c=y[ind])"
]
},
{
......@@ -111,7 +111,7 @@
"%%timeit\n",
"# Train and test the scikit-learn SGD logistic regression.\n",
"clf = sklearn.linear_model.SGDClassifier(\n",
" loss='log', n_iter=1000, penalty='l2', alpha=5e-4, class_weight='auto')\n",
" loss='log', n_iter=1000, penalty='l2', alpha=5e-4, class_weight='balanced')\n",
"\n",
"clf.fit(X, y)\n",
"yt_pred = clf.predict(Xt)\n",
......
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
from ._caffe import init_log, log, set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver, layer_type_list, set_random_seed, solver_count, set_solver_count, solver_rank, set_solver_rank, set_multiprocess, has_nccl
from ._caffe import __version__
from .proto.caffe_pb2 import TRAIN, TEST
from .classifier import Classifier
from .detector import Detector
from . import io
from .net_spec import layers, params, NetSpec, to_proto
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册