Removed ICNNNetReader interface (#1042)
authorIlya Lavrenov <ilya.lavrenov@intel.com>
Tue, 23 Jun 2020 19:34:26 +0000 (22:34 +0300)
committerGitHub <noreply@github.com>
Tue, 23 Jun 2020 19:34:26 +0000 (22:34 +0300)
* Removed ICNNNetReader interface

* Fixed stress tests

* Fixed comments in VPU plugin

* Removed duplicated stress tests

* Fixed watchdog tests

23 files changed:
inference-engine/ie_bridges/python/src/openvino/inference_engine/ie_api_impl.cpp
inference-engine/include/cpp/ie_cnn_net_reader.h [deleted file]
inference-engine/include/cpp/ie_cnn_network.h
inference-engine/include/ie_icnn_net_reader.h [deleted file]
inference-engine/include/inference_engine.hpp
inference-engine/src/inference_engine/ie_core.cpp
inference-engine/src/readers/ir_reader/ie_cnn_net_reader_impl.cpp
inference-engine/src/readers/ir_reader/ie_cnn_net_reader_impl.h
inference-engine/src/readers/ir_reader/ie_ir_reader.hpp
inference-engine/src/vpu/graph_transformer/src/stages/mtcnn.cpp
inference-engine/tests_deprecated/behavior/vpu/myriad_tests/vpu_boot_tests.cpp
inference-engine/tests_deprecated/behavior/vpu/myriad_tests/vpu_watchdog_tests.cpp
inference-engine/tests_deprecated/functional/shared_tests/transformations/concat_with_pooling_test.cpp
inference-engine/tests_deprecated/functional/shared_tests/transformations/single_layer_transformations_test.cpp
tests/stress_tests/common/ie_pipelines/pipelines.cpp
tests/stress_tests/common/ie_pipelines/pipelines.h
tests/stress_tests/memleaks_tests/tests.cpp
tests/stress_tests/memleaks_tests/tests_pipelines/tests_pipelines.cpp
tests/stress_tests/memleaks_tests/tests_pipelines/tests_pipelines.h
tests/stress_tests/unittests/tests.cpp
tests/stress_tests/unittests/tests_pipelines/tests_pipelines.cpp
tests/stress_tests/unittests/tests_pipelines/tests_pipelines.h
tests/stress_tests/unittests/tests_pipelines/tests_pipelines_full_pipeline.cpp

index d7e0cd9..3b0bb67 100644 (file)
@@ -166,12 +166,8 @@ PyObject *parse_parameter(const InferenceEngine::Parameter &param) {
 }
 
 InferenceEnginePython::IENetwork::IENetwork(const std::string &model, const std::string &weights) {
-    IE_SUPPRESS_DEPRECATED_START
-    InferenceEngine::CNNNetReader net_reader;
-    net_reader.ReadNetwork(model);
-    net_reader.ReadWeights(weights);
-    auto net = net_reader.getNetwork();
-    IE_SUPPRESS_DEPRECATED_END
+    InferenceEngine::Core reader;
+    auto net = reader.ReadNetwork(model, weights);
     actual = std::make_shared<InferenceEngine::CNNNetwork>(net);
     name = actual->getName();
     batch_size = actual->getBatchSize();
@@ -198,15 +194,11 @@ InferenceEnginePython::IENetwork::IENetwork(PyObject* network) {
 
 void
 InferenceEnginePython::IENetwork::load_from_buffer(const char *xml, size_t xml_size, uint8_t *bin, size_t bin_size) {
-    IE_SUPPRESS_DEPRECATED_START
-    InferenceEngine::CNNNetReader net_reader;
-    net_reader.ReadNetwork(xml, xml_size);
+    InferenceEngine::Core reader;
     InferenceEngine::TensorDesc tensorDesc(InferenceEngine::Precision::U8, { bin_size }, InferenceEngine::Layout::C);
     auto weights_blob = InferenceEngine::make_shared_blob<uint8_t>(tensorDesc, bin, bin_size);
-    net_reader.SetWeights(weights_blob);
-    name = net_reader.getName();
-    auto net = net_reader.getNetwork();
-    IE_SUPPRESS_DEPRECATED_END
+    auto net = reader.ReadNetwork(std::string(xml, xml + xml_size), weights_blob);
+    name = net.getName();
     actual = std::make_shared<InferenceEngine::CNNNetwork>(net);
     batch_size = actual->getBatchSize();
 }
diff --git a/inference-engine/include/cpp/ie_cnn_net_reader.h b/inference-engine/include/cpp/ie_cnn_net_reader.h
deleted file mode 100644 (file)
index 172f588..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-// Copyright (C) 2018-2020 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-/**
- * @brief This is a header file for the Network reader class (wrapper) used to build networks from a given IR
- * 
- * @file ie_cnn_net_reader.h
- */
-#pragma once
-
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "details/ie_exception_conversion.hpp"
-#include "details/os/os_filesystem.hpp"
-#include "ie_blob.h"
-#include "cpp/ie_cnn_network.h"
-#include "ie_common.h"
-#include "ie_icnn_net_reader.h"
-
-namespace InferenceEngine {
-/**
- * @deprecated Use InferenceEngine::Core::ReadNetwork methods. This API will be removed in 2021.1
- * @brief This is a wrapper class used to build and parse a network from the given IR.
- *
- * All the methods here can throw exceptions.
- */
-IE_SUPPRESS_DEPRECATED_START
-class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::Core::ReadNetwork methods. This API will be removed in 2021.1")
-    CNNNetReader {
-public:
-    /**
-     * @brief A smart pointer to this class
-     */
-    using Ptr = std::shared_ptr<CNNNetReader>;
-
-    /**
-     * @brief A default constructor
-     */
-    CNNNetReader(): actual(InferenceEngine::CreateCNNNetReaderPtr()) {
-        if (actual == nullptr) {
-            THROW_IE_EXCEPTION << "CNNNetReader was not initialized.";
-        }
-    }
-
-#ifdef ENABLE_UNICODE_PATH_SUPPORT
-    /**
-     * @brief Resolve wstring path then call original ReadNetwork
-     *
-     * Wraps ICNNNetReader::ReadNetwork
-     *
-     * @param filepath The full path to the .xml file of the IR
-     */
-    void ReadNetwork(const std::wstring& filepath) {
-        CALL_STATUS_FNC(ReadNetwork, details::wStringtoMBCSstringChar(filepath).c_str());
-    }
-#endif
-
-    /**
-     * @copybrief ICNNNetReader::ReadNetwork
-     *
-     * Wraps ICNNNetReader::ReadNetwork
-     *
-     * @param filepath The full path to the .xml file of the IR
-     */
-    void ReadNetwork(const std::string& filepath) {
-        CALL_STATUS_FNC(ReadNetwork, filepath.c_str());
-    }
-
-    /**
-     * @copybrief ICNNNetReader::ReadNetwork(const void*, size_t, ResponseDesc*)
-     *
-     * Wraps ICNNNetReader::ReadNetwork(const void*, size_t, ResponseDesc*)
-     *
-     * @param model Pointer to a char array with the IR
-     * @param size Size of the char array in bytes
-     */
-    void ReadNetwork(const void* model, size_t size) {
-        CALL_STATUS_FNC(ReadNetwork, model, size);
-    }
-
-    /**
-     * @copybrief ICNNNetReader::SetWeights
-     *
-     * Wraps ICNNNetReader::SetWeights
-     *
-     * @param weights Blob of bytes that holds all the IR binary data
-     */
-    void SetWeights(const TBlob<uint8_t>::Ptr& weights) {
-        CALL_STATUS_FNC(SetWeights, weights);
-    }
-
-#ifdef ENABLE_UNICODE_PATH_SUPPORT
-    /**
-     * @brief Resolve wstring path then call original ReadWeights
-     *
-     * ICNNNetReader::ReadWeights
-     *
-     * @param filepath Full path to the .bin file
-     */
-    void ReadWeights(const std::wstring& filepath) {
-        CALL_STATUS_FNC(ReadWeights, details::wStringtoMBCSstringChar(filepath).c_str());
-    }
-#endif
-
-    /**
-     * @copybrief ICNNNetReader::ReadWeights
-     *
-     * Wraps ICNNNetReader::ReadWeights
-     *
-     * @param filepath Full path to the .bin file
-     */
-    void ReadWeights(const std::string& filepath) {
-        CALL_STATUS_FNC(ReadWeights, filepath.c_str());
-    }
-
-    /**
-     * @brief Gets a copy of built network object
-     *
-     * @return A copy of the CNNNetwork object to be loaded
-     */
-    CNNNetwork getNetwork() {
-        // network obj are to be updated upon this call
-        if (network.get() == nullptr) {
-            try {
-                network.reset(new CNNNetwork(actual));
-            } catch (...) {
-                THROW_IE_EXCEPTION << "Could not allocate memory";
-            }
-        }
-        return *network.get();
-    }
-
-    /**
-     * @copybrief ICNNNetReader::isParseSuccess
-     *
-     * Wraps ICNNNetReader::isParseSuccess
-     *
-     * @return true if a parse is successful, false otherwise
-     */
-    bool isParseSuccess() const {
-        CALL_FNC_NO_ARGS(isParseSuccess);
-    }
-
-    /**
-     * @copybrief ICNNNetReader::getDescription
-     *
-     * Wraps ICNNNetReader::getDescription
-     *
-     * @return StatusCode that indicates the network status
-     */
-    std::string getDescription() const {
-        CALL_STATUS_FNC_NO_ARGS(getDescription);
-        return resp.msg;
-    }
-
-    /**
-     * @copybrief ICNNNetReader::getName
-     *
-     * Wraps ICNNNetReader::getName
-     *
-     * @return String
-     */
-    std::string getName() const {
-        char name[64];
-        CALL_STATUS_FNC(getName, name, sizeof(name) / sizeof(*name));
-        return name;
-    }
-
-    /**
-     * @copybrief ICNNNetReader::getVersion
-     *
-     * Wraps ICNNNetReader::getVersion
-     *
-     * @return IR version number: 1 or 2
-     */
-    int getVersion() const {
-        CALL_FNC_NO_ARGS(getVersion);
-    }
-
-private:
-    CNNNetReaderPtr actual;
-    std::shared_ptr<CNNNetwork> network;
-};
-IE_SUPPRESS_DEPRECATED_END
-}  // namespace InferenceEngine
index b45d075..a8a3311 100644 (file)
@@ -9,8 +9,6 @@
  */
 #pragma once
 
-#include <ie_icnn_net_reader.h>
-
 #include <details/ie_cnn_network_iterator.hpp>
 #include <details/ie_exception_conversion.hpp>
 #include <ie_icnn_network.hpp>
@@ -59,22 +57,6 @@ public:
     explicit CNNNetwork(const std::shared_ptr<const ngraph::Function>& network);
 
     /**
-     * @brief A constructor from ICNNNetReader object
-     *
-     * @param reader Pointer to the ICNNNetReader object
-     */
-    IE_SUPPRESS_DEPRECATED_START
-    explicit CNNNetwork(CNNNetReaderPtr reader_): reader(reader_) {
-        if (reader == nullptr) {
-            THROW_IE_EXCEPTION << "ICNNNetReader was not initialized.";
-        }
-        if ((actual = reader->getNetwork(nullptr)) == nullptr) {
-            THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
-        }
-    }
-    IE_SUPPRESS_DEPRECATED_END
-
-    /**
      * @brief A destructor
      */
     virtual ~CNNNetwork() {}
@@ -303,12 +285,6 @@ public:
 
 protected:
     /**
-     * @brief Reader extra reference, might be nullptr
-     */
-    IE_SUPPRESS_DEPRECATED_START
-    CNNNetReaderPtr reader;
-    IE_SUPPRESS_DEPRECATED_END
-    /**
      * @brief Network extra interface, might be nullptr
      */
     std::shared_ptr<ICNNNetwork> network;
diff --git a/inference-engine/include/ie_icnn_net_reader.h b/inference-engine/include/ie_icnn_net_reader.h
deleted file mode 100644 (file)
index 9407f15..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright (C) 2018-2020 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-/**
- * @brief A header file that provides interface for network reader that is used to build networks from a given IR
- *
- * @file ie_icnn_net_reader.h
- */
-#pragma once
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "details/ie_no_copy.hpp"
-#include "details/ie_so_pointer.hpp"
-#include "ie_api.h"
-#include "ie_blob.h"
-#include "ie_common.h"
-#include "ie_icnn_network.hpp"
-
-namespace InferenceEngine {
-/**
- * @deprecated Use InferenceEngine::Core::ReadNetwork methods. This API will be removed in 2021.1
- * @brief This class is the main interface to build and parse a network from a given IR
- *
- * All methods here do not throw exceptions and return a StatusCode and ResponseDesc object.
- * Alternatively, to use methods that throw exceptions, refer to the CNNNetReader wrapper class.
- */
-class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::Core::ReadNetwork methods. This API will be removed in 2021.1")
-    ICNNNetReader : public details::IRelease {
-public:
-    /**
-     * @brief Parses the topology part of the IR (.xml)
-     *
-     * This method can be called once only to read network. If you need to read another network instance then create new
-     * reader instance.
-     *
-     * @param filepath The full path to the .xml file of the IR
-     * @param resp Response message
-     * @return Result code
-     */
-    virtual StatusCode ReadNetwork(const char* filepath, ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Parses the topology part of the IR (.xml) given the xml as a buffer
-     *
-     * This method can be called once only to read network. If you need to read another network instance then create new
-     * reader instance.
-     *
-     * @param model Pointer to a char array with the IR
-     * @param resp Response message
-     * @param size Size of the char array in bytes
-     * @return Result code
-     */
-    virtual StatusCode ReadNetwork(const void* model, size_t size, ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Sets the weights buffer (.bin part) from the IR.
-     *
-     * Weights Blob must always be of bytes - the casting to precision is done per-layer to support mixed
-     * networks and to ease of use.
-     * This method can be called more than once to reflect updates in the .bin.
-     *
-     * @param weights Blob of bytes that holds all the IR binary data
-     * @param resp Response message
-     * @return Result code
-     */
-    virtual StatusCode SetWeights(const TBlob<uint8_t>::Ptr& weights, ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Loads and sets the weights buffer directly from the IR .bin file.
-     *
-     * This method can be called more than once to reflect updates in the .bin.
-     *
-     * @param filepath Full path to the .bin file
-     * @param resp Response message
-     * @return Result code
-     */
-    virtual StatusCode ReadWeights(const char* filepath, ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Returns a pointer to the built network
-     *
-     * @param resp Response message
-     * @return A pointer to a network
-     */
-    virtual ICNNNetwork* getNetwork(ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Retrieves the last building status
-     * @param resp Response message
-     * @return `True` in case of parsing is successful, `false` otherwise.
-     */
-    virtual bool isParseSuccess(ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Retrieves the last building failure message if failed
-     *
-     * @param resp Response message
-     * @return StatusCode that indicates the network status
-     */
-    virtual StatusCode getDescription(ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Gets network name
-     *
-     * @param name Pointer to preallocated buffer that receives network name
-     * @param len Length of the preallocated buffer, network name will be trimmed by this lenght
-     * @param resp Response message
-     * @return Result code
-     */
-    virtual StatusCode getName(char* name, size_t len, ResponseDesc* resp) noexcept = 0;
-
-    /**
-     * @brief Returns a version of IR
-     *
-     * @param resp Response message
-     * @return IR version number: 1 or 2
-     */
-    virtual int getVersion(ResponseDesc* resp) noexcept = 0;
-
-    virtual void addExtensions(const std::vector<InferenceEngine::IExtensionPtr>& ext) = 0;
-
-    /**
-     * @brief A virtual destructor.
-     */
-    ~ICNNNetReader() override = default;
-};
-
-IE_SUPPRESS_DEPRECATED_START
-
-namespace details {
-
-/**
- * @brief This class defines the name of the fabric for creating an ICNNNetReader object in DLL
- */
-template<>
-class SOCreatorTrait<ICNNNetReader> {
-public:
-    /**
-     * @brief A name of the fabric for creating ICNNNetReader object in DLL
-     */
-    static constexpr auto name = "CreateICNNNetReader";
-};
-
-}  // namespace details
-
-/**
- * @brief A C++ helper to work with objects created by the IR readers plugin.
- * Implements different interfaces.
- */
-using CNNNetReaderPtr = InferenceEngine::details::SOPointer<ICNNNetReader, InferenceEngine::details::SharedObjectLoader>;
-
-/**
- * @brief Creates a CNNNetReader instance
- * @return An object that implements the ICNNNetReader interface
- */
-INFERENCE_ENGINE_API_CPP(CNNNetReaderPtr) CreateCNNNetReaderPtr() noexcept;
-
-IE_SUPPRESS_DEPRECATED_END
-
-}  // namespace InferenceEngine
index 3072f2a..cf176ed 100644 (file)
@@ -11,7 +11,6 @@
 #include <ie_api.h>
 #include <ie_blob.h>
 #include <ie_layers.h>
-#include <cpp/ie_cnn_net_reader.h>
 #include <cpp/ie_executable_network.hpp>
 #include <ie_core.hpp>
 #include <ie_icnn_network.hpp>
index c0d7479..7ee3a96 100644 (file)
@@ -16,7 +16,6 @@
 #include <mutex>
 
 #include <ngraph/opsets/opset.hpp>
-#include "cpp/ie_cnn_net_reader.h"
 #include "ie_plugin_cpp.hpp"
 #include "cpp_interfaces/base/ie_plugin_base.hpp"
 #include "details/ie_exception_conversion.hpp"
@@ -127,11 +126,6 @@ Parameter copyParameterValue(const Parameter & value) {
 
 }  // namespace
 
-CNNNetReaderPtr CreateCNNNetReaderPtr() noexcept {
-    auto loader = createCnnReaderLoader();
-    return CNNNetReaderPtr(loader);
-}
-
 IE_SUPPRESS_DEPRECATED_END
 
 DeviceIDParser::DeviceIDParser(const std::string& deviceNameWithID) {
index 07575bc..c827a4e 100644 (file)
@@ -26,7 +26,6 @@ using namespace std;
 using namespace InferenceEngine;
 using namespace InferenceEngine::details;
 
-IE_SUPPRESS_DEPRECATED_START
 CNNNetReaderImpl::CNNNetReaderImpl(const FormatParserCreator::Ptr& _creator)
     : parseSuccess(false), _version(0), parserCreator(_creator) {}
 
@@ -193,11 +192,3 @@ void CNNNetReaderImpl::addExtensions(const std::vector<InferenceEngine::IExtensi
 std::shared_ptr<IFormatParser> V2FormatParserCreator::create(size_t version) {
     return std::make_shared<FormatParser>(version);
 }
-
-INFERENCE_PLUGIN_API(InferenceEngine::StatusCode)
-CreateICNNNetReader(ICNNNetReader *& data, ResponseDesc *resp) noexcept {
-    data = new CNNNetReaderImpl(std::make_shared<V2FormatParserCreator>());
-    return StatusCode::OK;
-}
-
-IE_SUPPRESS_DEPRECATED_END
index a291055..3d9cf33 100644 (file)
@@ -35,22 +35,21 @@ struct INFERENCE_ENGINE_API_CLASS(V2FormatParserCreator) : public FormatParserCr
     std::shared_ptr<IFormatParser> create(size_t version) override;
 };
 
-IE_SUPPRESS_DEPRECATED_START
-class INFERENCE_ENGINE_API_CLASS(CNNNetReaderImpl) : public ICNNNetReader {
+class INFERENCE_ENGINE_API_CLASS(CNNNetReaderImpl) {
 public:
     explicit CNNNetReaderImpl(const FormatParserCreator::Ptr& _creator);
 
-    StatusCode ReadNetwork(const char* filepath, ResponseDesc* resp) noexcept override;
+    StatusCode ReadNetwork(const char* filepath, ResponseDesc* resp) noexcept;
 
-    StatusCode ReadNetwork(const void* model, size_t size, ResponseDesc* resp) noexcept override;
+    StatusCode ReadNetwork(const void* model, size_t size, ResponseDesc* resp) noexcept;
 
     StatusCode ReadNetwork(const pugi::xml_node& root, ResponseDesc* resp);
 
-    StatusCode SetWeights(const TBlob<uint8_t>::Ptr& weights, ResponseDesc* resp) noexcept override;
+    StatusCode SetWeights(const TBlob<uint8_t>::Ptr& weights, ResponseDesc* resp) noexcept;
 
-    StatusCode ReadWeights(const char* filepath, ResponseDesc* resp) noexcept override;
+    StatusCode ReadWeights(const char* filepath, ResponseDesc* resp) noexcept;
 
-    ICNNNetwork* getNetwork(ResponseDesc* resp) noexcept override {
+    ICNNNetwork* getNetwork(ResponseDesc* resp) noexcept {
         IE_PROFILING_AUTO_SCOPE(CNNNetReaderImpl::getNetwork)
         return network.get();
     }
@@ -59,15 +58,15 @@ public:
         return network;
     }
 
-    bool isParseSuccess(ResponseDesc* resp) noexcept override {
+    bool isParseSuccess(ResponseDesc* resp) noexcept {
         return parseSuccess;
     }
 
-    StatusCode getDescription(ResponseDesc* desc) noexcept override {
+    StatusCode getDescription(ResponseDesc* desc) noexcept {
         return DescriptionBuffer(OK, desc) << description;
     }
 
-    StatusCode getName(char* name, size_t len, ResponseDesc* resp) noexcept override {
+    StatusCode getName(char* name, size_t len, ResponseDesc* resp) noexcept {
         if (len > 0) {
             size_t length = std::min(this->name.size(), len - 1);  // cut the name if buffer is too small
             ie_memcpy(name, len, this->name.c_str(), length);
@@ -76,17 +75,17 @@ public:
         return OK;
     }
 
-    int getVersion(ResponseDesc* resp) noexcept override {
+    int getVersion(ResponseDesc* resp) noexcept {
         return _version;
     }
 
-    void Release() noexcept override {
+    void Release() noexcept {
         delete this;
     }
 
-    void addExtensions(const std::vector<InferenceEngine::IExtensionPtr>& ext) override;
+    void addExtensions(const std::vector<InferenceEngine::IExtensionPtr>& ext);
 
-    ~CNNNetReaderImpl() override;
+    ~CNNNetReaderImpl();
 
 private:
     std::shared_ptr<InferenceEngine::details::IFormatParser> _parser;
@@ -105,7 +104,5 @@ private:
     std::vector<InferenceEngine::IExtensionPtr> extensions;
 };
 
-IE_SUPPRESS_DEPRECATED_END
-
 }  // namespace details
 }  // namespace InferenceEngine
index d8ddd04..7c9ba4b 100644 (file)
@@ -29,9 +29,6 @@ namespace InferenceEngine {
 
 /**
  * @brief This class is the main interface to build and parse a network from a given IR
- *
- * All methods here do not throw exceptions and return a StatusCode and ResponseDesc object.
- * Alternatively, to use methods that throw exceptions, refer to the CNNNetReader wrapper class.
  */
 class IRReader: public IReader {
 public:
index 8562df3..f4be0ab 100644 (file)
@@ -9,7 +9,7 @@
 #include <vpu/utils/file_system.hpp>
 #include <vpu/model/data_contents/mtcnn_blob_content.hpp>
 
-#include <cpp/ie_cnn_net_reader.h>
+#include <ie_core.hpp>
 
 #include <vector>
 #include <fstream>
@@ -112,15 +112,9 @@ ie::CNNNetwork loadSubNetwork(
     // Load network
     //
 
-    auto binFileName = fileNameNoExt(fileName) + ".bin";
-
-    IE_SUPPRESS_DEPRECATED_START
-    ie::CNNNetReader networkReader;
-    networkReader.ReadNetwork(fileName);
-    networkReader.ReadWeights(binFileName);
-
-    auto network = networkReader.getNetwork();
-    IE_SUPPRESS_DEPRECATED_END
+    // ticket 30632 : replace with ICore interface
+    InferenceEngine::Core reader;
+    auto network = reader.ReadNetwork(fileName);
 
     //
     // Set precision of input/output
index 9f88d7c..baa6ac1 100644 (file)
@@ -61,19 +61,11 @@ TEST_P(MYRIADBoot, DISABLED_ConnectToAlreadyBootedDevice) {
     bootOneDevice();
     ASSERT_EQ(getAmountOfBootedDevices(), 1);
     {
-        InferenceEnginePluginPtr plugin(make_plugin_name(GetParam().pluginName));
-        CNNNetReader reader;
-        reader.ReadNetwork(GetParam().model_xml_str.data(), GetParam().model_xml_str.length());
-
-        CNNNetwork network = reader.getNetwork();
-        ExecutableNetwork ret;
-
-        sts = plugin->LoadNetwork(ret, network, {
-                {KEY_LOG_LEVEL, LOG_DEBUG},
-                {KEY_VPU_MYRIAD_WATCHDOG, NO},
-        }, &response);
-
-        ASSERT_NE(StatusCode::OK, sts) << response.msg;
+        Core ie;
+        CNNNetwork network = ie.ReadNetwork(GetParam().model_xml_str, Blob::CPtr());
+        ExecutableNetwork net = ie.LoadNetwork(network, GetParam().device,
+            { {KEY_LOG_LEVEL, LOG_DEBUG},
+              {KEY_VPU_MYRIAD_WATCHDOG, NO} });
 
         ASSERT_EQ(getAmountOfBootedDevices(), 1);
     }
@@ -89,19 +81,11 @@ TEST_P(MYRIADBoot, DISABLED_OpenNotBootedDevice) {
     bootOneDevice();
     ASSERT_EQ(getAmountOfBootedDevices(), 1);
     {
-        InferenceEnginePluginPtr plugin(make_plugin_name(GetParam().pluginName));
-        CNNNetReader reader;
-        reader.ReadNetwork(GetParam().model_xml_str.data(), GetParam().model_xml_str.length());
-
-        CNNNetwork network = reader.getNetwork();
-        ExecutableNetwork ret;
-
-        sts = plugin->LoadNetwork(ret, network, {
-                {KEY_LOG_LEVEL, LOG_DEBUG},
-                {KEY_VPU_MYRIAD_WATCHDOG, NO},
-        }, &response);
-
-        ASSERT_NE(StatusCode::OK, sts) << response.msg;
+        Core ie;
+        CNNNetwork network = ie.ReadNetwork(GetParam().model_xml_str, Blob::CPtr());
+        ExecutableNetwork net = ie.LoadNetwork(network, GetParam().device,
+            { {KEY_LOG_LEVEL, LOG_DEBUG},
+              {KEY_VPU_MYRIAD_WATCHDOG, NO} });
 
         ASSERT_EQ(getAmountOfBootedDevices(), 2);
     }
index e292fdb..152c7b5 100644 (file)
@@ -11,6 +11,7 @@
 #include <thread>
 #include <file_utils.h>
 #include "vpu_test_data.hpp"
+#include "functional_test_utils/test_model/test_model.hpp"
 
 #include "helpers/myriad_devices.hpp"
 #include <details/ie_exception.hpp>
@@ -182,21 +183,15 @@ TEST_P(MYRIADWatchdog, watchDogIntervalDefault) {
     auto startup_devices = queryDevices();
     auto ctime = Time::now();
     {
-
         InferenceEngine::Core core;
-        IE_SUPPRESS_DEPRECATED_START
-        CNNNetReader reader;
-        reader.ReadNetwork(GetParam().model_xml_str.data(), GetParam().model_xml_str.length());
-
-        CNNNetwork network = reader.getNetwork();
-        IE_SUPPRESS_DEPRECATED_END
+        auto model = FuncTestUtils::TestModel::convReluNormPoolFcModelFP16;
+        CNNNetwork network = core.ReadNetwork(model.model_xml_str, model.weights_blob);
         ASSERT_GE(startup_devices.unbooted, 1);
 
         ExecutableNetwork ret;
         ctime = Time::now();
-        ASSERT_THROW(ret = core.LoadNetwork(network, GetParam().device, {
-            {KEY_LOG_LEVEL, LOG_INFO}}),
-            InferenceEngine::details::InferenceEngineException);
+        ret = core.LoadNetwork(network, GetParam().device, {
+            {KEY_LOG_LEVEL, LOG_INFO} });
 
         ASSERT_BOOTED_DEVICES_ONE_MORE();
 
@@ -222,20 +217,15 @@ TEST_P(MYRIADWatchdog, canTurnoffWatchDogViaConfig) {
     auto ctime = Time::now();
     {
         InferenceEngine::Core core;
-        IE_SUPPRESS_DEPRECATED_START
-        CNNNetReader reader;
-        reader.ReadNetwork(GetParam().model_xml_str.data(), GetParam().model_xml_str.length());
-
-        CNNNetwork network = reader.getNetwork();
-        IE_SUPPRESS_DEPRECATED_END
+        auto model = FuncTestUtils::TestModel::convReluNormPoolFcModelFP16;
+        CNNNetwork network = core.ReadNetwork(model.model_xml_str, model.weights_blob);
         ASSERT_GE(startup_devices.unbooted, 1);
 
         ExecutableNetwork ret;
         ctime = Time::now();
-        ASSERT_THROW(ret = core.LoadNetwork(network, GetParam().device, {
+        ret = core.LoadNetwork(network, GetParam().device, {
             {KEY_LOG_LEVEL, LOG_INFO},
-            {KEY_VPU_MYRIAD_WATCHDOG, NO}}),
-            InferenceEngine::details::InferenceEngineException);
+            {KEY_VPU_MYRIAD_WATCHDOG, NO}});
 
         ASSERT_BOOTED_DEVICES_ONE_MORE();
 
index 1dbe699..f060192 100644 (file)
@@ -138,12 +138,12 @@ void ConcatWithPoolingTestModel::resetTransformation(CNNNetwork& network) const
 }
 
 float ConcatWithPoolingTestModel::getThreshold(
-    const std::string& pluginName,
+    const std::string& deviceName,
     const Precision precision,
     LayerTransformation::Params& params) const {
     if (params.quantizeOutputs && signedIntervals && shift && (dequantizationIntervalsDifference != 0.f)) {
         return 0.0153;
     }
 
-    return SingleLayerTestModel::getThreshold(pluginName, precision, params);
+    return SingleLayerTestModel::getThreshold(deviceName, precision, params);
 }
index 39b162f..b701254 100644 (file)
@@ -6,7 +6,6 @@
 #include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
 #include "common/validation.hpp"
 #include "tests_common_func.hpp"
-#include <cpp/ie_cnn_net_reader.h>
 
 TBlob<uint8_t>::Ptr SingleLayerTransformationsTest::generateWeights(const CNNNetwork& network) {
     std::vector<Blob::Ptr> blobs;
index a9ce0a6..4a73a04 100644 (file)
@@ -22,17 +22,7 @@ std::function<void()> load_unload_plugin(const std::string &target_device) {
     };
 }
 
-std::function<void()> read_network(const std::string &model) {
-    return [&] {
-        IE_SUPPRESS_DEPRECATED_START
-        CNNNetReader netReader;
-        netReader.ReadNetwork(model);
-        netReader.ReadWeights(fileNameNoExt(model) + ".bin");
-        IE_SUPPRESS_DEPRECATED_END
-    };
-}
-
-std::function<void()> create_cnnnetwork(const std::string &model) {
+std::function<void()> read_cnnnetwork(const std::string &model) {
     return [&] {
         Core ie;
         CNNNetwork cnnNetwork = ie.ReadNetwork(model);
index 38e967e..f34a11c 100644 (file)
@@ -7,8 +7,7 @@
 #include <inference_engine.hpp>
 
 std::function<void()> load_unload_plugin(const std::string &target_device);
-std::function<void()> read_network(const std::string &model);
-std::function<void()> create_cnnnetwork(const std::string &model);
+std::function<void()> read_cnnnetwork(const std::string &model);
 std::function<void()> cnnnetwork_reshape_batch_x2(const std::string &model);
 std::function<void()> set_input_params(const std::string &model);
 std::function<void()> create_exenetwork(const std::string &model, const std::string &target_device);
index eebef0c..52e0683 100644 (file)
@@ -55,14 +55,6 @@ TEST_P(MemLeaksTestSuiteNoDevice, read_network) {
     test_runner(test_params.numthreads, test);
 }
 
-TEST_P(MemLeaksTestSuiteNoDevice, create_cnnnetwork) {
-    auto test_params = GetParam();
-    auto test = [&] {
-        return test_create_cnnnetwork(test_params.model, test_params.numiters);
-    };
-    test_runner(test_params.numthreads, test);
-}
-
 TEST_P(MemLeaksTestSuiteNoDevice, cnnnetwork_reshape_batch_x2) {
     auto test_params = GetParam();
     auto test = [&] {
index 4418211..ee7d484 100644 (file)
@@ -144,12 +144,7 @@ TestResult test_load_unload_plugin(const std::string& target_device, const int&
 
 TestResult test_read_network(const std::string& model, const int& n) {
     log_info("Read network: \"" << model << "\" for " << n << " times");
-    return common_test_pipeline(read_network(model), n);
-}
-
-TestResult test_create_cnnnetwork(const std::string& model, const int& n) {
-    log_info("Create CNNNetwork from network: \"" << model << "\" for " << n << " times");
-    return common_test_pipeline(create_cnnnetwork(model), n);
+    return common_test_pipeline(read_cnnnetwork(model), n);
 }
 
 TestResult test_cnnnetwork_reshape_batch_x2(const std::string& model, const int& n) {
index dd50968..79ac564 100644 (file)
@@ -15,7 +15,6 @@
 // tests_pipelines/tests_pipelines.cpp
 TestResult test_load_unload_plugin(const std::string &target_device, const int &n);
 TestResult test_read_network(const std::string &model, const int &n);
-TestResult test_create_cnnnetwork(const std::string &model, const int &n);
 TestResult test_cnnnetwork_reshape_batch_x2(const std::string &model, const int &n);
 TestResult test_set_input_params(const std::string &model, const int &n);
 TestResult test_recreate_exenetwork(InferenceEngine::Core &ie, const std::string &model, const std::string &target_device, const int &n);
index 33c9a68..4c480c9 100644 (file)
@@ -25,10 +25,6 @@ TEST_P(UnitTestSuiteNoDevice, read_network) {
     runTest(test_read_network, GetParam());
 }
 
-TEST_P(UnitTestSuiteNoDevice, create_cnnnetwork) {
-    runTest(test_create_cnnnetwork, GetParam());
-}
-
 TEST_P(UnitTestSuiteNoDevice, cnnnetwork_reshape_batch_x2) {
     runTest(test_cnnnetwork_reshape_batch_x2, GetParam());
 }
@@ -60,10 +56,6 @@ TEST_P(UnitTestSuite, read_network_full_pipeline) {
     runTest(test_read_network_full_pipeline, GetParam());
 }
 
-TEST_P(UnitTestSuite, create_cnnnetwork_full_pipeline) {
-    runTest(test_create_cnnnetwork_full_pipeline, GetParam());
-}
-
 TEST_P(UnitTestSuite, set_input_params_full_pipeline) {
     runTest(test_set_input_params_full_pipeline, GetParam());
 }
index 9ed7893..3bfd988 100644 (file)
@@ -27,17 +27,7 @@ void test_read_network(const std::string &model, const std::string &target_devic
         if (i == n / 2) {
             log_info("Half of the test have already passed");
         }
-        read_network(model)();
-    }
-}
-
-void test_create_cnnnetwork(const std::string &model, const std::string &target_device, const int &n) {
-    log_info("Create CNNNetwork from network: \"" << model << "\" for " << n << " times");
-    for (int i = 0; i < n; i++) {
-        if (i == n / 2) {
-            log_info("Half of the test have already passed");
-        }
-        create_cnnnetwork(model)();
+        read_cnnnetwork(model)();
     }
 }
 
index 94d2470..c8105ac 100644 (file)
@@ -12,7 +12,6 @@
 // tests_pipelines/tests_pipelines.cpp
 void test_load_unload_plugin(const std::string &model, const std::string &target_device, const int &n);
 void test_read_network(const std::string &model, const std::string &target_device, const int &n);
-void test_create_cnnnetwork(const std::string &model, const std::string &target_device, const int &n);
 void test_cnnnetwork_reshape_batch_x2(const std::string &model, const std::string &target_device, const int &n);
 void test_set_input_params(const std::string &model, const std::string &target_device, const int &n);
 void test_create_exenetwork(const std::string &model, const std::string &target_device, const int &n);
@@ -23,7 +22,6 @@ void test_infer_request_inference(const std::string &model, const std::string &t
 // tests_pipelines/tests_pipelines_full_pipeline.cpp
 void test_load_unload_plugin_full_pipeline(const std::string &model, const std::string &target_device, const int &n);
 void test_read_network_full_pipeline(const std::string &model, const std::string &target_device, const int &n);
-void test_create_cnnnetwork_full_pipeline(const std::string &model, const std::string &target_device, const int &n);
 void test_set_input_params_full_pipeline(const std::string &model, const std::string &target_device, const int &n);
 void test_cnnnetwork_reshape_batch_x2_full_pipeline(const std::string &model, const std::string &target_device, const int &n);
 void test_create_exenetwork_full_pipeline(const std::string &model, const std::string &target_device, const int &n);
index b038c55..51a9e3c 100644 (file)
@@ -65,38 +65,6 @@ void test_load_unload_plugin_full_pipeline(const std::string &model, const std::
 void test_read_network_full_pipeline(const std::string &model, const std::string &target_device, const int &n) {
     log_info("Read network: \"" << model << "\" for " << n << " times");
     Core ie;
-    IE_SUPPRESS_DEPRECATED_START
-    std::shared_ptr<CNNNetReader> netReaderPtr;
-    for (int i = 0; i < n; i++) {
-        if (i == n / 2) {
-            log_info("Half of the test have already passed");
-        }
-        CNNNetReader netReader;
-        netReader.ReadNetwork(model);
-        netReader.ReadWeights(fileNameNoExt(model) + ".bin");
-        netReaderPtr = std::make_shared<CNNNetReader>(netReader);
-    }
-    CNNNetwork cnnNetwork = netReaderPtr->getNetwork();
-    IE_SUPPRESS_DEPRECATED_END
-    InputsDataMap inputInfo(cnnNetwork.getInputsInfo());
-    ICNNNetwork::InputShapes shapes = cnnNetwork.getInputShapes();
-    bool doReshape = false;
-    for (auto &input : inputInfo) {
-        setInputParameters();
-        computeShapesToReshape();
-    }
-    reshapeCNNNetwork();
-    ExecutableNetwork exeNetwork = ie.LoadNetwork(cnnNetwork, target_device);
-    InferRequest infer_request = exeNetwork.CreateInferRequest();
-    infer_request.Infer();
-    OutputsDataMap output_info(cnnNetwork.getOutputsInfo());
-    for (auto &output : output_info)
-        Blob::Ptr outputBlob = infer_request.GetBlob(output.first);
-}
-
-void test_create_cnnnetwork_full_pipeline(const std::string &model, const std::string &target_device, const int &n) {
-    log_info("Create CNNNetwork from network: \"" << model << "\" for " << n << " times");
-    Core ie;
     CNNNetwork cnnNetwork;
     for (int i = 0; i < n; i++) {
         if (i == n / 2) {