Skip to content

Commit

Permalink
comment caffe cli
Browse files Browse the repository at this point in the history
  • Loading branch information
shelhamer committed Aug 7, 2014
1 parent 5c46d79 commit 7dcf592
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tools/caffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ static BrewFunction GetBrewFunction(const caffe::string& name) {
}
}

// caffe actions that could be called in the form
// caffe.bin action
// To do so, define actions as "int action()" functions, and register it with
// caffe commands to call by
// caffe <command> <args>
//
// To add a command, define a function "int command()" and register it with
// RegisterBrewFunction(action);

// Device Query: show diagnostic information for a GPU device.
int device_query() {
LOG(INFO) << "Querying device_id = " << FLAGS_device_id;
caffe::Caffe::SetDevice(FLAGS_device_id);
Expand All @@ -76,6 +78,8 @@ int device_query() {
}
RegisterBrewFunction(device_query);


// Train / Finetune a model.
int train() {
CHECK_GT(FLAGS_solver.size(), 0) << "Need a solver definition to train.";
CHECK(!FLAGS_snapshot.size() || !FLAGS_weights.size())
Expand All @@ -102,6 +106,8 @@ int train() {
}
RegisterBrewFunction(train);


// Time: benchmark the execution time of a model.
int time() {
CHECK_GT(FLAGS_model.size(), 0) << "Need a model definition to time.";

Expand Down

0 comments on commit 7dcf592

Please sign in to comment.