From 63e92cccf2c38c3c7a041d7968063a9a2445d40c Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 22 Jun 2020 11:45:56 +0300 Subject: [PATCH] Conditional compilation for network reader --- modules/dnn/test/test_ie_models.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/dnn/test/test_ie_models.cpp b/modules/dnn/test/test_ie_models.cpp index 565db4cd47..be0b0faa83 100644 --- a/modules/dnn/test/test_ie_models.cpp +++ b/modules/dnn/test/test_ie_models.cpp @@ -136,12 +136,6 @@ void runIE(Target target, const std::string& xmlPath, const std::string& binPath { SCOPED_TRACE("runIE"); - CNNNetReader reader; - reader.ReadNetwork(xmlPath); - reader.ReadWeights(binPath); - - CNNNetwork net = reader.getNetwork(); - std::string device_name; #if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GT(2019010000) @@ -150,6 +144,17 @@ void runIE(Target target, const std::string& xmlPath, const std::string& binPath InferenceEnginePluginPtr enginePtr; InferencePlugin plugin; #endif + +#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GT(2019030000) + CNNNetwork net = ie.ReadNetwork(xmlPath, binPath); +#else + CNNNetReader reader; + reader.ReadNetwork(xmlPath); + reader.ReadWeights(binPath); + + CNNNetwork net = reader.getNetwork(); +#endif + ExecutableNetwork netExec; InferRequest infRequest;