Skip to content

Commit

Permalink
LOG(ERROR)->LOG(FATAL), and misc script changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangqing Jia committed Jul 26, 2014
1 parent 70b01f2 commit 9862d5a
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/cifar10/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Training the model is simple after you have written the network definition proto
cd $CAFFE_ROOT/examples/cifar10
./train_quick.sh

`train_quick.sh` is a simple script, so have a look inside. `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main tool for training is `train_net.bin`, with the solver protobuf text file as its argument.
`train_quick.sh` is a simple script, so have a look inside. `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main tool for training is `caffe.bin` with the `train` action, and the solver protobuf text file as its argument.

When you run the code, you will see a lot of messages flying by like this:

Expand Down
16 changes: 8 additions & 8 deletions examples/cifar10/train_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin \
cifar10_full_solver.prototxt
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=cifar10_full_solver.prototxt

#reduce learning rate by factor of 10
GLOG_logtostderr=1 $TOOLS/train_net.bin \
cifar10_full_solver_lr1.prototxt \
cifar10_full_iter_60000.solverstate
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=cifar10_full_solver_lr1.prototxt \
--resume_point_file=cifar10_full_iter_60000.solverstate

#reduce learning rate by factor of 10
GLOG_logtostderr=1 $TOOLS/train_net.bin \
cifar10_full_solver_lr2.prototxt \
cifar10_full_iter_65000.solverstate
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=cifar10_full_solver_lr2.prototxt \
--resume_point_file=cifar10_full_iter_65000.solverstate
7 changes: 5 additions & 2 deletions examples/cifar10/train_quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin cifar10_quick_solver.prototxt
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=cifar10_quick_solver.prototxt

#reduce learning rate by fctor of 10 after 8 epochs
GLOG_logtostderr=1 $TOOLS/train_net.bin cifar10_quick_solver_lr1.prototxt cifar10_quick_iter_4000.solverstate
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=cifar10_quick_solver_lr1.prototxt \
--resume_point_file=cifar10_quick_iter_4000.solverstate
5 changes: 3 additions & 2 deletions examples/imagenet/resume_training.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin \
imagenet_solver.prototxt caffe_imagenet_train_10000.solverstate
GLOG_logtostderr=1 $TOOLS/caffe.bin train\
--solver_proto_file=imagenet_solver.prototxt \
--resume_point_file=caffe_imagenet_train_10000.solverstate

echo "Done."
3 changes: 2 additions & 1 deletion examples/imagenet/train_alexnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin alexnet_solver.prototxt
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=alexnet_solver.prototxt

echo "Done."
3 changes: 2 additions & 1 deletion examples/imagenet/train_imagenet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin imagenet_solver.prototxt
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=imagenet_solver.prototxt

echo "Done."
2 changes: 1 addition & 1 deletion examples/mnist/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Training the model is simple after you have written the network definition proto
cd $CAFFE_ROOT/examples/mnist
./train_lenet.sh

`train_lenet.sh` is a simple script, but here are a few explanations: `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main tool for training is `train_net.bin`, with the solver protobuf text file as its argument.
`train_lenet.sh` is a simple script, but here are a few explanations: `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main tool for training is `caffe.bin` with action `train`, with the solver protobuf text file as its argument.

When you run the code, you will see a lot of messages flying by like this:

Expand Down
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin lenet_solver.prototxt
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=lenet_solver.prototxt
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet_consolidated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin lenet_consolidated_solver.prototxt
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=lenet_consolidated_solver.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 @@
#!/bin/bash
TOOLS=../../build/tools

GLOG_logtostderr=1 $TOOLS/train_net.bin mnist_autoencoder_solver.prototxt
GLOG_logtostderr=1 $TOOLS/caffe.bin train \
--solver_proto_file=mnist_autoencoder_solver.prototxt
2 changes: 1 addition & 1 deletion tools/device_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "caffe/common.hpp"

int main(int argc, char** argv) {
LOG(ERROR) << "Deprecated. Use caffe.bin devicequery "
LOG(FATAL) << "Deprecated. Use caffe.bin devicequery "
"[--device_id=0] instead.";
return 0;
}
2 changes: 1 addition & 1 deletion tools/finetune_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "caffe/caffe.hpp"

int main(int argc, char** argv) {
LOG(ERROR) << "Deprecated. Use caffe.bin train --solver_proto_file=... "
LOG(FATAL) << "Deprecated. Use caffe.bin train --solver_proto_file=... "
"[--pretrained_net_file=...] instead.";
return 0;
}
2 changes: 1 addition & 1 deletion tools/net_speed_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "caffe/caffe.hpp"

int main(int argc, char** argv) {
LOG(ERROR) << "Deprecated. Use caffe.bin speedtest --net_proto_file=... "
LOG(FATAL) << "Deprecated. Use caffe.bin speedtest --net_proto_file=... "
"[--run_iterations=50] [--speedtest_with_gpu] [--device_id=0]";
return 0;
}
2 changes: 1 addition & 1 deletion tools/train_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "caffe/caffe.hpp"

int main(int argc, char** argv) {
LOG(ERROR) << "Deprecated. Use caffe.bin train --solver_proto_file=... "
LOG(FATAL) << "Deprecated. Use caffe.bin train --solver_proto_file=... "
"[--resume_point_file=...] instead.";
return 0;
}

0 comments on commit 9862d5a

Please sign in to comment.