// Fill prototxt
{
std::ifstream ifs{cmdline.at(0)};
- from_txt(ifs, *frontend->prototxt());
+ if (!ifs.is_open())
+ {
+ throw std::runtime_error("Prototxt file open fail");
+ }
+
+ if (!from_txt(ifs, *frontend->prototxt()))
+ {
+ throw std::runtime_error("Filling prototxt fail");
+ }
}
// Fill caffemodel
{
std::ifstream ifs{cmdline.at(1), std::ios::binary};
- from_bin(ifs, *frontend->caffemodel());
+ if (!ifs.is_open())
+ {
+ throw std::runtime_error("Caffemodel file open fail");
+ }
+
+ if (!from_bin(ifs, *frontend->caffemodel()))
+ {
+ throw std::runtime_error("Filling caffemodel fail");
+ }
}
return std::move(frontend);