Commit 50a52424 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

dnn: fix possible build problem with tensor flow, get rid of catch(...)

parent 10aee918
......@@ -374,15 +374,7 @@ Ptr<Importer> cv::dnn::createCaffeImporter(const String&, const String&)
Net cv::dnn::readNetFromCaffe(const String &prototxt, const String &caffeModel /*= String()*/)
{
Ptr<Importer> caffeImporter;
try
{
caffeImporter = createCaffeImporter(prototxt, caffeModel);
}
catch(...)
{
}
Ptr<Importer> caffeImporter = createCaffeImporter(prototxt, caffeModel);
Net net;
if (caffeImporter)
caffeImporter->populateNet(net);
......
......@@ -736,23 +736,6 @@ void TFImporter::populateNet(Net dstNet)
} // namespace
Net cv::dnn::readNetFromTensorflow(const String &model)
{
Ptr<Importer> importer;
try
{
importer = createTensorflowImporter(model);
}
catch(...)
{
}
Net net;
if (importer)
importer->populateNet(net);
return net;
}
Ptr<Importer> cv::dnn::createTensorflowImporter(const String &model)
{
return Ptr<Importer>(new TFImporter(model.c_str()));
......@@ -767,3 +750,12 @@ Ptr<Importer> cv::dnn::createTensorflowImporter(const String&)
}
#endif //HAVE_PROTOBUF
Net cv::dnn::readNetFromTensorflow(const String &model)
{
Ptr<Importer> importer = createTensorflowImporter(model);
Net net;
if (importer)
importer->populateNet(net);
return net;
}
......@@ -989,15 +989,7 @@ Mat readTorchBlob(const String&, bool)
Net readNetFromTorch(const String &model, bool isBinary)
{
Ptr<Importer> importer;
try
{
importer = createTorchImporter(model, isBinary);
}
catch(...)
{
}
Ptr<Importer> importer = createTorchImporter(model, isBinary);
Net net;
if (importer)
importer->populateNet(net);
......
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