Commit 7c741f54 authored by Dmitry Kurtaev's avatar Dmitry Kurtaev

Wrap custom OpenCV layers to try-catch

parent a67228cd
...@@ -323,7 +323,14 @@ void InfEngineNgraphNet::initPlugin(InferenceEngine::CNNNetwork& net) ...@@ -323,7 +323,14 @@ void InfEngineNgraphNet::initPlugin(InferenceEngine::CNNNetwork& net)
} }
// Some of networks can work without a library of extra layers. // Some of networks can work without a library of extra layers.
// OpenCV fallbacks as extensions. // OpenCV fallbacks as extensions.
ie.AddExtension(std::make_shared<InfEngineExtension>(), "CPU"); try
{
ie.AddExtension(std::make_shared<InfEngineExtension>(), "CPU");
}
catch(const std::exception& e)
{
CV_LOG_INFO(NULL, "DNN-IE: Can't register OpenCV custom layers extension: " << e.what());
}
#ifndef _WIN32 #ifndef _WIN32
// Limit the number of CPU threads. // Limit the number of CPU threads.
if (device_name == "CPU") if (device_name == "CPU")
......
...@@ -738,7 +738,14 @@ void InfEngineBackendNet::initPlugin(InferenceEngine::CNNNetwork& net) ...@@ -738,7 +738,14 @@ void InfEngineBackendNet::initPlugin(InferenceEngine::CNNNetwork& net)
// Some of networks can work without a library of extra layers. // Some of networks can work without a library of extra layers.
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2019R1) #if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2019R1)
// OpenCV fallbacks as extensions. // OpenCV fallbacks as extensions.
ie.AddExtension(std::make_shared<InfEngineExtension>(), "CPU"); try
{
ie.AddExtension(std::make_shared<InfEngineExtension>(), "CPU");
}
catch(const std::exception& e)
{
CV_LOG_INFO(NULL, "DNN-IE: Can't register OpenCV custom layers extension: " << e.what());
}
#endif #endif
#ifndef _WIN32 #ifndef _WIN32
// Limit the number of CPU threads. // Limit the number of CPU threads.
......
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