Skip to content

Commit

Permalink
Merge pull request BVLC#4 from BVLC/master
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
yjxiong committed Aug 25, 2014
2 parents 288412e + 99bea71 commit 421c6a3
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Please cite Caffe in your publications if it helps your research:
Author = {Yangqing Jia},
Title = { {Caffe}: An Open Source Convolutional Architecture for Fast Feature Embedding},
Year = {2013},
Howpublished = {\url{http://caffe.berkeleyvision.org/}
Howpublished = {\url{http://caffe.berkeleyvision.org/}}
}

If you do publish a paper where Caffe helped your research, we encourage you to update the [publications wiki](https://github.com/BVLC/caffe/wiki/Publications).
Expand Down
6 changes: 4 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ In other `ENV` settings, things may not work as expected.
Simply run the following:

brew install --build-from-source --with-python boost
for x in snappy leveldb protobuf gflags glog szip lmdb homebrew/science/opencv; do brew install $x; done
brew install --with-python protobuf
for x in snappy leveldb gflags glog szip lmdb homebrew/science/opencv; do brew install $x; done

Building boost from source is needed to link against your local Python (exceptions might be raised during some OS X installs, but **ignore** these and continue). If you do not need the Python wrapper, simply doing `brew install boost` is fine.

Expand Down Expand Up @@ -172,7 +173,8 @@ To edit the formulae in turn, run

After this, run

for x in snappy leveldb protobuf gflags glog szip lmdb homebrew/science/opencv; do brew uninstall $x; brew install --build-from-source --fresh -vd $x; done
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

**Note** that `brew install --build-from-source --fresh -vd boost` is fine if you do not need the Caffe Python wrapper.
Expand Down
4 changes: 2 additions & 2 deletions examples/imagenet/imagenet_full_conv.prototxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: "CaffeNetConv"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 454
input_dim: 454
input_dim: 451
input_dim: 451
layers {
name: "conv1"
type: CONVOLUTION
Expand Down
62 changes: 40 additions & 22 deletions examples/net_surgery.ipynb

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions tools/caffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ int train() {

LOG(INFO) << "Starting Optimization";
caffe::SGDSolver<float> solver(solver_param);

// Set device id and mode
if (FLAGS_gpu >= 0) {
LOG(INFO) << "Use GPU with device ID " << FLAGS_gpu;
Caffe::SetDevice(FLAGS_gpu);
Caffe::set_mode(Caffe::GPU);
} else if (!solver_param.has_solver_mode()) {
LOG(INFO) << "Use CPU.";
Caffe::set_mode(Caffe::CPU);
}

if (FLAGS_snapshot.size()) {
LOG(INFO) << "Resuming from " << FLAGS_snapshot;
solver.Solve(FLAGS_snapshot);
Expand Down

0 comments on commit 421c6a3

Please sign in to comment.