From aaccb48bd29fef703e0260bbc47685960797d7a1 Mon Sep 17 00:00:00 2001 From: Jonathan L Long Date: Mon, 6 Oct 2014 12:34:18 -0700 Subject: [PATCH 1/6] [fix] check solver prototxt parsing --- src/caffe/solver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/caffe/solver.cpp b/src/caffe/solver.cpp index 8d187ea638b..ba262920a9a 100644 --- a/src/caffe/solver.cpp +++ b/src/caffe/solver.cpp @@ -23,7 +23,7 @@ template Solver::Solver(const string& param_file) : net_() { SolverParameter param; - ReadProtoFromTextFile(param_file, ¶m); + ReadProtoFromTextFileOrDie(param_file, ¶m); Init(param); } From 57d14637d6b337d4a1bb854dcb402c56a6eb44d5 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Wed, 8 Oct 2014 19:56:07 -0700 Subject: [PATCH 2/6] [example] fix data script paths for flickr fine-tuning --- examples/finetune_flickr_style/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/finetune_flickr_style/readme.md b/examples/finetune_flickr_style/readme.md index 4220102e7f7..e0183510bef 100644 --- a/examples/finetune_flickr_style/readme.md +++ b/examples/finetune_flickr_style/readme.md @@ -34,7 +34,7 @@ All steps are to be done from the caffe root directory. The dataset is distributed as a list of URLs with corresponding labels. Using a script, we will download a small subset of the data and split it into train and val sets. - caffe % ./models/finetune_flickr_style/assemble_data.py -h + caffe % ./examples/finetune_flickr_style/assemble_data.py -h usage: assemble_data.py [-h] [-s SEED] [-i IMAGES] [-w WORKERS] Download a subset of Flickr Style to a directory @@ -48,7 +48,7 @@ Using a script, we will download a small subset of the data and split it into tr num workers used to download images. -x uses (all - x) cores. - caffe % python models/finetune_flickr_style/assemble_data.py --workers=-1 --images=2000 --seed 831486 + caffe % python examples/finetune_flickr_style/assemble_data.py --workers=-1 --images=2000 --seed 831486 Downloading 2000 images with 7 workers... Writing train/val for 1939 successfully downloaded images. From 3ff2201f2706f8aa1522b635a2d46f4003abc032 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Thu, 9 Oct 2014 21:00:03 -0700 Subject: [PATCH 3/6] [example] add LeNet to MNIST title, fix paths to be from root --- examples/mnist/readme.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/mnist/readme.md b/examples/mnist/readme.md index 44e0091f420..2b8f0d782d4 100644 --- a/examples/mnist/readme.md +++ b/examples/mnist/readme.md @@ -1,6 +1,6 @@ --- -title: MNIST Tutorial -description: Train and test "LeNet" on MNIST data. +title: LeNet MNIST Tutorial +description: Train and test "LeNet" on the MNIST handwritten digit data. category: example include_in_docs: true priority: 1 @@ -14,10 +14,9 @@ We will assume that you have Caffe successfully compiled. If not, please refer t You will first need to download and convert the data format from the MNIST website. To do this, simply run the following commands: - cd $CAFFE_ROOT/data/mnist - ./get_mnist.sh - cd $CAFFE_ROOT/examples/mnist - ./create_mnist.sh + cd $CAFFE_ROOT + ./data/mnist/get_mnist.sh + ./examples/mnist/create_mnist.sh If it complains that `wget` or `gunzip` are not installed, you need to install them respectively. After running the script there should be two datasets, `mnist_train_lmdb`, and `mnist_test_lmdb`. @@ -228,8 +227,8 @@ Check out the comments explaining each line in the prototxt `$CAFFE_ROOT/example Training the model is simple after you have written the network definition protobuf and solver protobuf files. Simply run `train_lenet.sh`, or the following command directly: - cd $CAFFE_ROOT/examples/mnist - ./train_lenet.sh + cd $CAFFE_ROOT + ./examples/mnist/train_lenet.sh `train_lenet.sh` is a simple script, but here is a quick explanation: the main tool for training is `caffe` with action `train` and the solver protobuf text file as its argument. From 5d2fb984347339c0ca2988a21215a2647bb90781 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Thu, 9 Oct 2014 21:01:41 -0700 Subject: [PATCH 4/6] [example] re-title LeNet / MNIST heading too --- examples/mnist/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mnist/readme.md b/examples/mnist/readme.md index 2b8f0d782d4..33ed371b4a1 100644 --- a/examples/mnist/readme.md +++ b/examples/mnist/readme.md @@ -6,7 +6,7 @@ include_in_docs: true priority: 1 --- -# Training MNIST with Caffe +# Training LeNet on MNIST with Caffe We will assume that you have Caffe successfully compiled. If not, please refer to the [Installation page](/installation.html). In this tutorial, we will assume that your Caffe installation is located at `CAFFE_ROOT`. From cb60a41c246c36680431ad7cf5535395d61d5cb7 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Thu, 9 Oct 2014 22:43:36 -0700 Subject: [PATCH 5/6] [docs] update homebrew instructions for boost and boost-python split --- docs/installation.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index dbf73d2c067..7cfa04eca1f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -18,7 +18,7 @@ Caffe depends on several software packages. * [CUDA](https://developer.nvidia.com/cuda-zone) library version 6.5 (recommended), 6.0, 5.5, or 5.0 and the latest driver version for CUDA 6 or 319.* for CUDA 5 (and NOT 331.*) * [BLAS](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) (provided via ATLAS, MKL, or OpenBLAS). * [OpenCV](http://opencv.org/). -* [Boost](http://www.boost.org/) (>= 1.55, although only 1.55 is tested) +* [Boost](http://www.boost.org/) (>= 1.55, although only 1.55 and 1.56 are tested) * `glog`, `gflags`, `protobuf`, `leveldb`, `snappy`, `hdf5`, `lmdb` * For the Python wrapper * `Python 2.7`, `numpy (>= 1.7)`, boost-provided `boost.python` @@ -145,7 +145,7 @@ In other `ENV` settings, things may not work as expected. Simply run the following: - brew install --build-from-source --with-python boost + brew install --build-from-source boost boost-python brew install --with-python protobuf for x in snappy leveldb gflags glog szip lmdb homebrew/science/opencv; do brew install $x; done @@ -186,16 +186,16 @@ After this, run for x in snappy leveldb gflags glog szip lmdb homebrew/science/opencv; do brew uninstall $x; brew install --build-from-source --fresh -vd $x; done brew uninstall protobuf; brew install --build-from-source --with-python --fresh -vd protobuf - brew install --build-from-source --with-python --fresh -vd boost + brew install --build-from-source --fresh -vd boost boost-python **Note** that `brew install --build-from-source --fresh -vd boost` is fine if you do not need the Caffe Python wrapper. **Note** that the HDF5 dependency is provided by Anaconda Python in this case. If you're not using Anaconda, include `hdf5` in the list above. -**Note** that in order to build the caffe python wrappers you must install boost using the --with-python option: +**Note** that in order to build the Caffe Python wrappers you must install `boost` and `boost-python`: - brew install --build-from-source --with-python --fresh -vd boost + brew install --build-from-source --fresh -vd boost boost-python **Note** that Homebrew maintains itself as a separate git repository and making the above `brew edit FORMULA` changes will change files in your local copy of homebrew's master branch. By default, this will prevent you from updating Homebrew using `brew update`, as you will get an error message like the following: From e6deb5dfaccec378dd3e1481dadc69b7ddd08502 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Thu, 9 Oct 2014 23:59:10 -0700 Subject: [PATCH 6/6] [docs] note boost 1.56 an CUDA conflict on OS X --- docs/installation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/installation.md b/docs/installation.md index 7cfa04eca1f..7eaf31c6d45 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -141,6 +141,8 @@ Do `brew edit opencv` and change the lines that look like the two lines below to **NOTE**: We find that everything compiles successfully if `$LD_LIBRARY_PATH` is not set at all, and `$DYLD_FALLBACK_LIBRARY_PATH` is set to to provide CUDA, Python, and other relevant libraries (e.g. `/usr/local/cuda/lib:$HOME/anaconda/lib:/usr/local/lib:/usr/lib`). In other `ENV` settings, things may not work as expected. +**NOTE**: There is currently a conflict between boost 1.56 and CUDA in some configurations. Check the [conflict description](https://github.com/BVLC/caffe/issues/1193#issuecomment-57491906) and try downgrading to 1.55. + #### 10.8-specific Instructions Simply run the following: