Improved error management for network loading failure.

parent 3fe19e3b
Pipeline #81056 passed with stages
in 3 minutes and 13 seconds
......@@ -45,17 +45,16 @@ class ${tc.fileNameWithoutEnding}{
caffe2::GlobalInit(&n, a);
if (!std::ifstream(FLAGS_init_net).good()) {
std::cerr << "Network loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
exit(1);
}
if (!std::ifstream(FLAGS_predict_net).good()) {
std::cerr << "Network loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
exit(1);
}
std::cout << "****************************************************************" << std::endl;
std::cout << "Loading network..." << std::endl;
std::cout << "\nLoading network..." << std::endl;
// Read protobuf
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &initNet));
......
......@@ -45,17 +45,16 @@ class CNNPredictor_Alexnet{
caffe2::GlobalInit(&n, a);
if (!std::ifstream(FLAGS_init_net).good()) {
std::cerr << "Network loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
exit(1);
}
if (!std::ifstream(FLAGS_predict_net).good()) {
std::cerr << "Network loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
exit(1);
}
std::cout << "****************************************************************" << std::endl;
std::cout << "Loading network..." << std::endl;
std::cout << "\nLoading network..." << std::endl;
// Read protobuf
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &initNet));
......
......@@ -45,17 +45,16 @@ class CNNPredictor_CifarClassifierNetwork{
caffe2::GlobalInit(&n, a);
if (!std::ifstream(FLAGS_init_net).good()) {
std::cerr << "Network loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
exit(1);
}
if (!std::ifstream(FLAGS_predict_net).good()) {
std::cerr << "Network loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
exit(1);
}
std::cout << "****************************************************************" << std::endl;
std::cout << "Loading network..." << std::endl;
std::cout << "\nLoading network..." << std::endl;
// Read protobuf
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &initNet));
......
......@@ -45,17 +45,16 @@ class CNNPredictor_VGG16{
caffe2::GlobalInit(&n, a);
if (!std::ifstream(FLAGS_init_net).good()) {
std::cerr << "Network loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
exit(1);
}
if (!std::ifstream(FLAGS_predict_net).good()) {
std::cerr << "Network loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
return;
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
exit(1);
}
std::cout << "****************************************************************" << std::endl;
std::cout << "Loading network..." << std::endl;
std::cout << "\nLoading network..." << std::endl;
// Read protobuf
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &initNet));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment