From 9862d5a4dcc70edba94291a64c303b659e7bd362 Mon Sep 17 00:00:00 2001 From: Yangqing Jia Date: Sat, 26 Jul 2014 08:37:05 -0700 Subject: [PATCH] LOG(ERROR)->LOG(FATAL), and misc script changes. --- examples/cifar10/readme.md | 2 +- examples/cifar10/train_full.sh | 16 ++++++++-------- examples/cifar10/train_quick.sh | 7 +++++-- examples/imagenet/resume_training.sh | 5 +++-- examples/imagenet/train_alexnet.sh | 3 ++- examples/imagenet/train_imagenet.sh | 3 ++- examples/mnist/readme.md | 2 +- examples/mnist/train_lenet.sh | 3 ++- examples/mnist/train_lenet_consolidated.sh | 3 ++- examples/mnist/train_mnist_autoencoder.sh | 3 ++- tools/device_query.cpp | 2 +- tools/finetune_net.cpp | 2 +- tools/net_speed_benchmark.cpp | 2 +- tools/train_net.cpp | 2 +- 14 files changed, 32 insertions(+), 23 deletions(-) diff --git a/examples/cifar10/readme.md b/examples/cifar10/readme.md index 9d5bd7b2b0c..315713f7022 100644 --- a/examples/cifar10/readme.md +++ b/examples/cifar10/readme.md @@ -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: diff --git a/examples/cifar10/train_full.sh b/examples/cifar10/train_full.sh index 4db7b9a98f1..930b27a1a32 100755 --- a/examples/cifar10/train_full.sh +++ b/examples/cifar10/train_full.sh @@ -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 diff --git a/examples/cifar10/train_quick.sh b/examples/cifar10/train_quick.sh index 1d954b5935e..5e8fffccd48 100755 --- a/examples/cifar10/train_quick.sh +++ b/examples/cifar10/train_quick.sh @@ -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 diff --git a/examples/imagenet/resume_training.sh b/examples/imagenet/resume_training.sh index 2b3b4031b5d..b43a9b1bf7c 100755 --- a/examples/imagenet/resume_training.sh +++ b/examples/imagenet/resume_training.sh @@ -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." diff --git a/examples/imagenet/train_alexnet.sh b/examples/imagenet/train_alexnet.sh index c91e9108ae5..d43a235dba1 100755 --- a/examples/imagenet/train_alexnet.sh +++ b/examples/imagenet/train_alexnet.sh @@ -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." diff --git a/examples/imagenet/train_imagenet.sh b/examples/imagenet/train_imagenet.sh index 0d2563b0c9d..90dcdfaddb8 100755 --- a/examples/imagenet/train_imagenet.sh +++ b/examples/imagenet/train_imagenet.sh @@ -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." diff --git a/examples/mnist/readme.md b/examples/mnist/readme.md index d609cfff9aa..4f3f4d9ce12 100644 --- a/examples/mnist/readme.md +++ b/examples/mnist/readme.md @@ -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: diff --git a/examples/mnist/train_lenet.sh b/examples/mnist/train_lenet.sh index c30fc3e02e1..4d0f1eea051 100755 --- a/examples/mnist/train_lenet.sh +++ b/examples/mnist/train_lenet.sh @@ -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 diff --git a/examples/mnist/train_lenet_consolidated.sh b/examples/mnist/train_lenet_consolidated.sh index ff6897e263d..802c801e31f 100755 --- a/examples/mnist/train_lenet_consolidated.sh +++ b/examples/mnist/train_lenet_consolidated.sh @@ -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 diff --git a/examples/mnist/train_mnist_autoencoder.sh b/examples/mnist/train_mnist_autoencoder.sh index af2245e07f0..3fb493534db 100755 --- a/examples/mnist/train_mnist_autoencoder.sh +++ b/examples/mnist/train_mnist_autoencoder.sh @@ -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 diff --git a/tools/device_query.cpp b/tools/device_query.cpp index a87e23c8722..efdbbbbc90e 100644 --- a/tools/device_query.cpp +++ b/tools/device_query.cpp @@ -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; } diff --git a/tools/finetune_net.cpp b/tools/finetune_net.cpp index 17b7f3a7bce..213ff01702a 100644 --- a/tools/finetune_net.cpp +++ b/tools/finetune_net.cpp @@ -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; } diff --git a/tools/net_speed_benchmark.cpp b/tools/net_speed_benchmark.cpp index 9e6bb4cbe95..f520e1d7785 100644 --- a/tools/net_speed_benchmark.cpp +++ b/tools/net_speed_benchmark.cpp @@ -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; } diff --git a/tools/train_net.cpp b/tools/train_net.cpp index 35b1c776470..08602d4a7ca 100644 --- a/tools/train_net.cpp +++ b/tools/train_net.cpp @@ -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; }