Skip to content

Commit e58ce89

Browse files
ilya-lavrenovalalek
authored andcommitted
Conditional compilation for IR v7 support
backported commit 8690575
1 parent 6259ba1 commit e58ce89

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/dnn/src/dnn.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,6 +3263,9 @@ Net Net::Impl::createNetworkFromModelOptimizer(InferenceEngine::CNNNetwork& ieNe
32633263
}
32643264
else
32653265
{
3266+
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
3267+
CV_Error(Error::StsNotImplemented, "This OpenCV version is built with Inference Engine which has dropped IR v7 support");
3268+
#else
32663269
CV_TRACE_REGION("legacy_cnn_layer");
32673270
try
32683271
{
@@ -3278,6 +3281,8 @@ Net Net::Impl::createNetworkFromModelOptimizer(InferenceEngine::CNNNetwork& ieNe
32783281
CV_LOG_DEBUG(NULL, "IE layer extraction failure: '" << name << "' - " << e.what());
32793282
return false;
32803283
}
3284+
#endif
3285+
32813286
}
32823287
};
32833288

modules/dnn/src/op_inf_engine.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#define INF_ENGINE_RELEASE_2020_1 2020010000
2727
#define INF_ENGINE_RELEASE_2020_2 2020020000
2828
#define INF_ENGINE_RELEASE_2020_3 2020030000
29+
#define INF_ENGINE_RELEASE_2020_4 2020040000
2930

3031
#ifndef INF_ENGINE_RELEASE
3132
#warning("IE version have not been provided via command-line. Using 2020.3 by default")

0 commit comments

Comments
 (0)