19 #include "caffe2/core/init.h" 20 #include "caffe2/core/operator.h" 21 #include "caffe2/proto/caffe2.pb.h" 22 #include "caffe2/utils/proto_utils.h" 23 #include "caffe2/core/logging.h" 25 CAFFE2_DEFINE_string(plan,
"",
"The given path to the plan protobuffer.");
27 int main(
int argc,
char** argv) {
30 MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_ret);
31 if (mpi_ret != MPI_THREAD_MULTIPLE &&
32 mpi_ret != MPI_THREAD_SERIALIZED) {
33 std::cerr <<
"Caffe2 MPI requires the underlying MPI to support the " 34 "MPI_THREAD_SERIALIZED or MPI_THREAD_MULTIPLE mode.\n";
38 LOG(INFO) <<
"Loading plan: " << caffe2::FLAGS_plan;
39 caffe2::PlanDef plan_def;
40 CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_plan, &plan_def));
42 workspace->RunPlan(plan_def);
45 caffe2::ShutdownProtobufLibrary();
bool GlobalInit(int *pargc, char ***pargv)
Initialize the global environment of caffe2.
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
void SetUsageMessage(const string &str)
Sets the usage message when a commandline tool is called with "--help".