From e58ce89b10619c3507278564226270a94150ad10 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 24 Jun 2020 23:58:18 +0300 Subject: [PATCH] Conditional compilation for IR v7 support backported commit 86905754e482fb265731840dcf9b36e6a2675c0d --- modules/dnn/src/dnn.cpp | 5 +++++ modules/dnn/src/op_inf_engine.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index da1e901fa3..0c98c82eb7 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -3263,6 +3263,9 @@ Net Net::Impl::createNetworkFromModelOptimizer(InferenceEngine::CNNNetwork& ieNe } else { +#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4) + CV_Error(Error::StsNotImplemented, "This OpenCV version is built with Inference Engine which has dropped IR v7 support"); +#else CV_TRACE_REGION("legacy_cnn_layer"); try { @@ -3278,6 +3281,8 @@ Net Net::Impl::createNetworkFromModelOptimizer(InferenceEngine::CNNNetwork& ieNe CV_LOG_DEBUG(NULL, "IE layer extraction failure: '" << name << "' - " << e.what()); return false; } +#endif + } }; diff --git a/modules/dnn/src/op_inf_engine.hpp b/modules/dnn/src/op_inf_engine.hpp index 359bbaa9f5..351840f3f2 100644 --- a/modules/dnn/src/op_inf_engine.hpp +++ b/modules/dnn/src/op_inf_engine.hpp @@ -26,6 +26,7 @@ #define INF_ENGINE_RELEASE_2020_1 2020010000 #define INF_ENGINE_RELEASE_2020_2 2020020000 #define INF_ENGINE_RELEASE_2020_3 2020030000 +#define INF_ENGINE_RELEASE_2020_4 2020040000 #ifndef INF_ENGINE_RELEASE #warning("IE version have not been provided via command-line. Using 2020.3 by default")