Commit 70060917 authored by nilsfreyer's avatar nilsfreyer

fixed tests for predictor templates

parent df09d622
Pipeline #104119 failed with stages
in 37 seconds
......@@ -18,8 +18,8 @@
#include <iostream>
#include <map>
CAFFE2_DEFINE_string(init_net, "./model/${tc.componentName}/init_net.pb", "The given path to the init protobuffer.");
CAFFE2_DEFINE_string(predict_net, "./model/${tc.componentName}/predict_net.pb", "The given path to the predict protobuffer.");
CAFFE2_DEFINE_string(init_net_${tc.fileNameWithoutEnding}, "./model/${tc.componentName}/init_net_${tc.fileNameWithoutEnding}.pb", "The given path to the init protobuffer.");
CAFFE2_DEFINE_string(predict_net_${tc.fileNameWithoutEnding}, "./model/${tc.componentName}/predict_net_${tc.fileNameWithoutEnding}.pb", "The given path to the predict protobuffer.");
using namespace caffe2;
......@@ -43,21 +43,21 @@ class ${tc.fileNameWithoutEnding}{
char **a[1];
caffe2::GlobalInit(&n, a);
if (!std::ifstream(FLAGS_init_net).good()) {
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
if (!std::ifstream(FLAGS_init_net_${tc.fileNameWithoutEnding}).good()) {
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net_${tc.fileNameWithoutEnding} << "' does not exist." << std::endl;
exit(1);
}
if (!std::ifstream(FLAGS_predict_net).good()) {
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
if (!std::ifstream(FLAGS_predict_net_${tc.fileNameWithoutEnding}).good()) {
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net_${tc.fileNameWithoutEnding} << "' does not exist." << std::endl;
exit(1);
}
std::cout << "\nLoading network..." << std::endl;
// Read protobuf
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &initNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net, &predictNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net_${tc.fileNameWithoutEnding}, &initNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net_${tc.fileNameWithoutEnding}, &predictNet));
// Set device type
#ifdef USE_GPU
......
......@@ -18,8 +18,8 @@
#include <iostream>
#include <map>
CAFFE2_DEFINE_string(init_net, "./model/LeNet/init_net.pb", "The given path to the init protobuffer.");
CAFFE2_DEFINE_string(predict_net, "./model/LeNet/predict_net.pb", "The given path to the predict protobuffer.");
CAFFE2_DEFINE_string(init_net_CNNPredictor_LeNet, "./model/LeNet/init_net_CNNPredictor_LeNet.pb", "The given path to the init protobuffer.");
CAFFE2_DEFINE_string(predict_net_CNNPredictor_LeNet, "./model/LeNet/predict_net_CNNPredictor_LeNet.pb", "The given path to the predict protobuffer.");
using namespace caffe2;
......@@ -43,21 +43,21 @@ class CNNPredictor_LeNet{
char **a[1];
caffe2::GlobalInit(&n, a);
if (!std::ifstream(FLAGS_init_net).good()) {
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
if (!std::ifstream(FLAGS_init_net_CNNPredictor_LeNet).good()) {
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net_CNNPredictor_LeNet << "' does not exist." << std::endl;
exit(1);
}
if (!std::ifstream(FLAGS_predict_net).good()) {
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
if (!std::ifstream(FLAGS_predict_net_CNNPredictor_LeNet).good()) {
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net_CNNPredictor_LeNet << "' does not exist." << std::endl;
exit(1);
}
std::cout << "\nLoading network..." << std::endl;
// Read protobuf
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &initNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net, &predictNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net_CNNPredictor_LeNet, &initNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net_CNNPredictor_LeNet, &predictNet));
// Set device type
#ifdef USE_GPU
......
......@@ -18,8 +18,8 @@
#include <iostream>
#include <map>
CAFFE2_DEFINE_string(init_net, "./model/VGG16/init_net.pb", "The given path to the init protobuffer.");
CAFFE2_DEFINE_string(predict_net, "./model/VGG16/predict_net.pb", "The given path to the predict protobuffer.");
CAFFE2_DEFINE_string(init_net_CNNPredictor_VGG16, "./model/VGG16/init_net_CNNPredictor_VGG16.pb", "The given path to the init protobuffer.");
CAFFE2_DEFINE_string(predict_net_CNNPredictor_VGG16, "./model/VGG16/predict_net_CNNPredictor_VGG16.pb", "The given path to the predict protobuffer.");
using namespace caffe2;
......@@ -43,21 +43,21 @@ class CNNPredictor_VGG16{
char **a[1];
caffe2::GlobalInit(&n, a);
if (!std::ifstream(FLAGS_init_net).good()) {
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net << "' does not exist." << std::endl;
if (!std::ifstream(FLAGS_init_net_CNNPredictor_VGG16).good()) {
std::cerr << "\nNetwork loading failure, init_net file '" << FLAGS_init_net_CNNPredictor_VGG16 << "' does not exist." << std::endl;
exit(1);
}
if (!std::ifstream(FLAGS_predict_net).good()) {
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net << "' does not exist." << std::endl;
if (!std::ifstream(FLAGS_predict_net_CNNPredictor_VGG16).good()) {
std::cerr << "\nNetwork loading failure, predict_net file '" << FLAGS_predict_net_CNNPredictor_VGG16 << "' does not exist." << std::endl;
exit(1);
}
std::cout << "\nLoading network..." << std::endl;
// Read protobuf
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &initNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net, &predictNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net_CNNPredictor_VGG16, &initNet));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net_CNNPredictor_VGG16, &predictNet));
// Set device type
#ifdef USE_GPU
......@@ -114,4 +114,4 @@ class CNNPredictor_VGG16{
}
};
#endif // CNNPREDICTOR_VGG16
\ No newline at end of file
#endif // CNNPREDICTOR_VGG16
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