From 5c46d79da98cc5a090bffd489cfbaca1b6f9e35d Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Wed, 6 Aug 2014 23:22:40 -0700 Subject: [PATCH] check required caffe cli args --- tools/caffe.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/caffe.cpp b/tools/caffe.cpp index 1320b7a..089fef3 100644 --- a/tools/caffe.cpp +++ b/tools/caffe.cpp @@ -77,7 +77,10 @@ int device_query() { RegisterBrewFunction(device_query); int train() { - CHECK_GT(FLAGS_solver.size(), 0); + CHECK_GT(FLAGS_solver.size(), 0) << "Need a solver definition to train."; + CHECK(!FLAGS_snapshot.size() || !FLAGS_weights.size()) + << "Give a snapshot to resume training or weights to finetune " + "but not both."; caffe::SolverParameter solver_param; caffe::ReadProtoFromTextFileOrDie(FLAGS_solver, &solver_param); @@ -100,6 +103,8 @@ int train() { RegisterBrewFunction(train); int time() { + CHECK_GT(FLAGS_model.size(), 0) << "Need a model definition to time."; + // Set device id and mode if (FLAGS_gpu) { LOG(INFO) << "Use GPU with device id " << FLAGS_device_id; -- 2.7.4