Skip to content

Commit

Permalink
Merge pull request BVLC#97 from zer0n/master
Browse files Browse the repository at this point in the history
Sync with latest BVLC
  • Loading branch information
zer0n authored Jul 14, 2016
2 parents a0532d3 + 9663905 commit ddf2ae4
Show file tree
Hide file tree
Showing 89 changed files with 3,167 additions and 292 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ models/*

# build, distribute, and bins (+ python proto bindings)
build
windows/packages
.build_debug/*
.build_release/*
distribute/*
Expand Down Expand Up @@ -100,4 +101,4 @@ MANIFEST-*
*.sdf
*.opensdf
*.pdb
*.props
*.props
59 changes: 36 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
# Use a build matrix to do two builds in parallel:
# one using CMake, and one using make.
dist: trusty
sudo: required

language: cpp
compiler: gcc

env:
global:
- NUM_THREADS=4
matrix:
- WITH_CUDA=false WITH_CMAKE=false WITH_IO=true
- WITH_CUDA=false WITH_CMAKE=true WITH_IO=true PYTHON_VERSION=3
- WITH_CUDA=true WITH_CMAKE=false WITH_IO=true
- WITH_CUDA=true WITH_CMAKE=true WITH_IO=true
- WITH_CUDA=false WITH_CMAKE=false WITH_IO=false
- WITH_CUDA=false WITH_CMAKE=true WITH_IO=false PYTHON_VERSION=3
# Use a build matrix to test many builds in parallel
# envvar defaults:
# WITH_CMAKE: false
# WITH_PYTHON3: false
# WITH_IO: true
# WITH_CUDA: false
# WITH_CUDNN: false
- BUILD_NAME="default-make"
# - BUILD_NAME="python3-make" WITH_PYTHON3=true
- BUILD_NAME="no-io-make" WITH_IO=false
- BUILD_NAME="cuda-make" WITH_CUDA=true
- BUILD_NAME="cudnn-make" WITH_CUDA=true WITH_CUDNN=true

language: cpp
- BUILD_NAME="default-cmake" WITH_CMAKE=true
- BUILD_NAME="python3-cmake" WITH_CMAKE=true WITH_PYTHON3=true
- BUILD_NAME="no-io-cmake" WITH_CMAKE=true WITH_IO=false
- BUILD_NAME="cuda-cmake" WITH_CMAKE=true WITH_CUDA=true
- BUILD_NAME="cudnn-cmake" WITH_CMAKE=true WITH_CUDA=true WITH_CUDNN=true

# Cache Ubuntu apt packages.
cache:
timeout: 604800 # 1 week
apt: true
directories:
- /home/travis/miniconda
- /home/travis/miniconda2
- /home/travis/miniconda3

compiler: gcc
- ~/protobuf3

before_install:
- export NUM_THREADS=4
- export SCRIPTS=./scripts/travis
- export CONDA_DIR="/home/travis/miniconda$PYTHON_VERSION"
- source ./scripts/travis/defaults.sh

install:
- sudo -E $SCRIPTS/travis_install.sh
- sudo -E ./scripts/travis/install-deps.sh
- ./scripts/travis/setup-venv.sh ~/venv
- source ~/venv/bin/activate
- ./scripts/travis/install-python-deps.sh

before_script:
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/cuda/lib64:$CONDA_DIR/lib
- export PATH=$CONDA_DIR/bin:$PATH
- if ! $WITH_CMAKE; then $SCRIPTS/travis_setup_makefile_config.sh; fi
- ./scripts/travis/configure.sh

script: $SCRIPTS/travis_build_and_test.sh
script:
- ./scripts/travis/build.sh
- ./scripts/travis/test.sh

notifications:
# Emails are sent to the committer's git-configured email address by default,
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ endif()
project(Caffe C CXX)

# ---[ Caffe version
set(CAFFE_TARGET_VERSION "1.0.0-rc3")
set(CAFFE_TARGET_SOVERSION "1.0.0-rc3")
set(CAFFE_TARGET_VERSION "1.0.0-rc3" CACHE STRING "Caffe logical version")
set(CAFFE_TARGET_SOVERSION "1.0.0-rc3" CACHE STRING "Caffe soname version")
add_definitions(-DCAFFE_VERSION=${CAFFE_TARGET_VERSION})

# ---[ Using cmake scripts and modules
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ endif
ifeq ($(OSX), 1)
CXX := /usr/bin/clang++
ifneq ($(CPU_ONLY), 1)
CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release [0-9.]*' | grep -o '[0-9.]*')
CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release [0-9.]*' | tr -d '[a-z ]')
ifeq ($(shell echo | awk '{exit $(CUDA_VERSION) < 7.0;}'), 1)
CXXFLAGS += -stdlib=libstdc++
LINKFLAGS += -stdlib=libstdc++
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you don't have CUDA installed, you can experiment with CPU_ONLY build.
In `.\windows\CommonSettings.props` set `CpuOnlyBuild` to `true` and set `UseCuDNN` to `false`.

### cuDNN
Download `cuDNN v3` or `cuDNN v4` [from nVidia website](https://developer.nvidia.com/cudnn).
Download `cuDNN v4` or `cuDNN v5` [from nVidia website](https://developer.nvidia.com/cudnn).
Unpack downloaded zip to %CUDA_PATH% (environment variable set by CUDA installer).
Alternatively, you can unpack zip to any location and set `CuDnnPath` to point to this location in `.\windows\CommonSettings.props`.
`CuDnnPath` defined in `.\windows\CommonSettings.props`.
Expand Down
2 changes: 1 addition & 1 deletion data/cifar10/get_cifar10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This scripts downloads the CIFAR10 (binary version) data and unzips it.

DIR="$( cd "$(dirname "$0")" ; pwd -P )"
cd $DIR
cd "$DIR"

echo "Downloading..."

Expand Down
2 changes: 1 addition & 1 deletion data/ilsvrc12/get_ilsvrc_aux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# - the training splits with labels

DIR="$( cd "$(dirname "$0")" ; pwd -P )"
cd $DIR
cd "$DIR"

echo "Downloading..."

Expand Down
2 changes: 1 addition & 1 deletion data/mnist/get_mnist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This scripts downloads the mnist data and unzips it.

DIR="$( cd "$(dirname "$0")" ; pwd -P )"
cd $DIR
cd "$DIR"

echo "Downloading..."

Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ docker_files: standalone_files

standalone_files: standalone/cpu/Dockerfile standalone/gpu/Dockerfile

FROM_GPU = "nvidia/cuda:7.5-cudnn4-devel-ubuntu14.04"
FROM_GPU = "nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04"
FROM_CPU = "ubuntu:14.04"
GPU_CMAKE_ARGS = -DUSE_CUDNN=1
CPU_CMAKE_ARGS = -DCPU_ONLY=1
Expand Down
2 changes: 1 addition & 1 deletion docker/standalone/gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nvidia/cuda:7.5-cudnn4-devel-ubuntu14.04
FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04
MAINTAINER caffe-maint@googlegroups.com

RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ Optional dependencies:

* [OpenCV](http://opencv.org/) >= 2.4 including 3.0
* IO libraries: `lmdb`, `leveldb` (note: leveldb requires `snappy`)
* cuDNN for GPU acceleration (v4)
* cuDNN for GPU acceleration (v5)

Pycaffe and Matcaffe interfaces have their own natural needs.

* For Python Caffe: `Python 2.7` or `Python 3.3+`, `numpy (>= 1.7)`, boost-provided `boost.python`
* For MATLAB Caffe: MATLAB with the `mex` compiler.

**cuDNN Caffe**: for fastest operation Caffe is accelerated by drop-in integration of [NVIDIA cuDNN](https://developer.nvidia.com/cudnn). To speed up your Caffe models, install cuDNN then uncomment the `USE_CUDNN := 1` flag in `Makefile.config` when installing Caffe. Acceleration is automatic. The current version is cuDNN v4; older versions are supported in older Caffe.
**cuDNN Caffe**: for fastest operation Caffe is accelerated by drop-in integration of [NVIDIA cuDNN](https://developer.nvidia.com/cudnn). To speed up your Caffe models, install cuDNN then uncomment the `USE_CUDNN := 1` flag in `Makefile.config` when installing Caffe. Acceleration is automatic. The current version is cuDNN v5; older versions are supported in older Caffe.

**CPU-only Caffe**: for cold-brewed CPU-only Caffe uncomment the `CPU_ONLY := 1` flag in `Makefile.config` to configure and build Caffe without CUDA. This is helpful for cloud or cluster deployment.

Expand Down
1 change: 1 addition & 0 deletions examples/cifar10/create_cifar10.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env sh
# This script converts the cifar data into leveldb format.
set -e

EXAMPLE=examples/cifar10
DATA=data/cifar10
Expand Down
7 changes: 4 additions & 3 deletions examples/cifar10/train_full.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_solver.prototxt
--solver=examples/cifar10/cifar10_full_solver.prototxt $@

# reduce learning rate by factor of 10
$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_solver_lr1.prototxt \
--snapshot=examples/cifar10/cifar10_full_iter_60000.solverstate.h5
--snapshot=examples/cifar10/cifar10_full_iter_60000.solverstate.h5 $@

# reduce learning rate by factor of 10
$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_solver_lr2.prototxt \
--snapshot=examples/cifar10/cifar10_full_iter_65000.solverstate.h5
--snapshot=examples/cifar10/cifar10_full_iter_65000.solverstate.h5 $@
3 changes: 2 additions & 1 deletion examples/cifar10/train_full_sigmoid.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_sigmoid_solver.prototxt
--solver=examples/cifar10/cifar10_full_sigmoid_solver.prototxt $@

3 changes: 2 additions & 1 deletion examples/cifar10/train_full_sigmoid_bn.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_sigmoid_solver_bn.prototxt
--solver=examples/cifar10/cifar10_full_sigmoid_solver_bn.prototxt $@

5 changes: 3 additions & 2 deletions examples/cifar10/train_quick.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_quick_solver.prototxt
--solver=examples/cifar10/cifar10_quick_solver.prototxt $@

# reduce learning rate by factor of 10 after 8 epochs
$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_quick_solver_lr1.prototxt \
--snapshot=examples/cifar10/cifar10_quick_iter_4000.solverstate.h5
--snapshot=examples/cifar10/cifar10_quick_iter_4000.solverstate.h5 $@
1 change: 1 addition & 0 deletions examples/imagenet/create_imagenet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
# Create the imagenet lmdb inputs
# N.B. set the path to the imagenet train + val data dirs
set -e

EXAMPLE=examples/imagenet
DATA=data/ilsvrc12
Expand Down
4 changes: 3 additions & 1 deletion examples/imagenet/resume_training.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=models/bvlc_reference_caffenet/solver.prototxt \
--snapshot=models/bvlc_reference_caffenet/caffenet_train_10000.solverstate.h5
--snapshot=models/bvlc_reference_caffenet/caffenet_train_10000.solverstate.h5 \
$@
3 changes: 2 additions & 1 deletion examples/imagenet/train_caffenet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=models/bvlc_reference_caffenet/solver.prototxt
--solver=models/bvlc_reference_caffenet/solver.prototxt $@
Binary file added examples/images/cat gray.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/mnist/create_mnist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
# This script converts the mnist data into lmdb/leveldb format,
# depending on the value assigned to $BACKEND.
set -e

EXAMPLE=examples/mnist
DATA=data/mnist
Expand Down
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train --solver=examples/mnist/lenet_solver.prototxt
./build/tools/caffe train --solver=examples/mnist/lenet_solver.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet_adam.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train --solver=examples/mnist/lenet_solver_adam.prototxt
./build/tools/caffe train --solver=examples/mnist/lenet_solver_adam.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet_consolidated.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=examples/mnist/lenet_consolidated_solver.prototxt
--solver=examples/mnist/lenet_consolidated_solver.prototxt $@
4 changes: 3 additions & 1 deletion examples/mnist/train_lenet_rmsprop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train --solver=examples/mnist/lenet_solver_rmsprop.prototxt
./build/tools/caffe train \
--solver=examples/mnist/lenet_solver_rmsprop.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver.prototxt
--solver=examples/mnist/mnist_autoencoder_solver.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder_adadelta.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_adadelta.prototxt
--solver=examples/mnist/mnist_autoencoder_solver_adadelta.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder_adagrad.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_adagrad.prototxt
--solver=examples/mnist/mnist_autoencoder_solver_adagrad.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder_nesterov.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_nesterov.prototxt
--solver=examples/mnist/mnist_autoencoder_solver_nesterov.prototxt $@
Loading

0 comments on commit ddf2ae4

Please sign in to comment.