fix #38545 remove CPU network layer check for py samples (#2145)
authorKate Generalova <kate.generalova@intel.com>
Thu, 10 Sep 2020 09:44:13 +0000 (12:44 +0300)
committerGitHub <noreply@github.com>
Thu, 10 Sep 2020 09:44:13 +0000 (12:44 +0300)
inference-engine/ie_bridges/python/sample/classification_sample/classification_sample.py
inference-engine/ie_bridges/python/sample/classification_sample_async/classification_sample_async.py
inference-engine/ie_bridges/python/sample/object_detection_sample_ssd/object_detection_sample_ssd.py
inference-engine/ie_bridges/python/sample/style_transfer_sample/style_transfer_sample.py

index 80fb4bd..3a132ae 100644 (file)
@@ -63,18 +63,6 @@ def main():
     # Read IR
     log.info("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin))
     net = ie.read_network(model=model_xml, weights=model_bin)
-    func = ng.function_from_cnn(net)
-
-    if "CPU" in args.device:
-        supported_layers = ie.query_network(net, "CPU")
-        ops = func.get_ordered_ops()
-        not_supported_layers = [op.friendly_name for op in ops if op.friendly_name not in supported_layers]
-        if len(not_supported_layers) != 0:
-            log.error("Following layers are not supported by the plugin for specified device {}:\n {}".
-                      format(args.device, ', '.join(not_supported_layers)))
-            log.error("Please try to specify cpu extensions library path in sample's command line parameters using -l "
-                      "or --cpu_extension command line argument")
-            sys.exit(1)
 
     assert len(net.input_info.keys()) == 1, "Sample supports only single input topologies"
     assert len(net.outputs) == 1, "Sample supports only single output topologies"
index 9fbf95a..da2a5fe 100644 (file)
@@ -108,18 +108,7 @@ def main():
     # Read IR
     log.info("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin))
     net = ie.read_network(model=model_xml, weights=model_bin)
-    func = ng.function_from_cnn(net)
-
-    if "CPU" in args.device:
-        supported_layers = ie.query_network(net, "CPU")
-        ops = func.get_ordered_ops()
-        not_supported_layers = [op.friendly_name for op in ops if op.friendly_name not in supported_layers]
-        if len(not_supported_layers) != 0:
-            log.error("Following layers are not supported by the plugin for specified device {}:\n {}".
-                      format(args.device, ', '.join(not_supported_layers)))
-            log.error("Please try to specify cpu extensions library path in sample's command line parameters using -l "
-                      "or --cpu_extension command line argument")
-            sys.exit(1)
+
     assert len(net.input_info.keys()) == 1, "Sample supports only single input topologies"
     assert len(net.outputs) == 1, "Sample supports only single output topologies"
 
index 862abe4..64ef7aa 100644 (file)
@@ -73,16 +73,6 @@ def main():
     if args.cpu_extension and "CPU" in args.device:
         ie.add_extension(args.cpu_extension, "CPU")
         log.info("CPU extension loaded: {}".format(args.cpu_extension))
-
-    if "CPU" in args.device:
-        supported_layers = ie.query_network(net, "CPU")
-        not_supported_layers = [op.friendly_name for op in ops if op.friendly_name not in supported_layers]
-        if len(not_supported_layers) != 0:
-            log.error("Following layers are not supported by the plugin for specified device {}:\n {}".
-                      format(args.device, ', '.join(not_supported_layers)))
-            log.error("Please try to specify cpu extensions library path in sample's command line parameters using -l "
-                      "or --cpu_extension command line argument")
-            sys.exit(1)
     # -----------------------------------------------------------------------------------------------------
 
     # --------------------------- 3. Read and preprocess input --------------------------------------------
index f6c8bd0..9531aba 100644 (file)
@@ -67,18 +67,6 @@ def main():
     # Read IR
     log.info("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin))
     net = ie.read_network(model=model_xml, weights=model_bin)
-    func = ng.function_from_cnn(net)
-
-    if "CPU" in args.device:
-        supported_layers = ie.query_network(net, "CPU")
-        ops = func.get_ordered_ops()
-        not_supported_layers = [op.friendly_name for op in ops if op.friendly_name not in supported_layers]
-        if len(not_supported_layers) != 0:
-            log.error("Following layers are not supported by the plugin for specified device {}:\n {}".
-                      format(args.device, ', '.join(not_supported_layers)))
-            log.error("Please try to specify cpu extensions library path in sample's command line parameters using -l "
-                      "or --cpu_extension command line argument")
-            sys.exit(1)
 
     assert len(net.input_info.keys()) == 1, "Sample supports only single input topologies"
     assert len(net.outputs) == 1, "Sample supports only single output topologies"