From: Kate Generalova Date: Thu, 10 Sep 2020 09:44:13 +0000 (+0300) Subject: fix #38545 remove CPU network layer check for py samples (#2145) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4d460101d6b87e0b56c49b17ecc7f0c6cc67a2a;p=platform%2Fupstream%2Fdldt.git fix #38545 remove CPU network layer check for py samples (#2145) --- diff --git a/inference-engine/ie_bridges/python/sample/classification_sample/classification_sample.py b/inference-engine/ie_bridges/python/sample/classification_sample/classification_sample.py index 80fb4bd..3a132ae 100644 --- a/inference-engine/ie_bridges/python/sample/classification_sample/classification_sample.py +++ b/inference-engine/ie_bridges/python/sample/classification_sample/classification_sample.py @@ -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" diff --git a/inference-engine/ie_bridges/python/sample/classification_sample_async/classification_sample_async.py b/inference-engine/ie_bridges/python/sample/classification_sample_async/classification_sample_async.py index 9fbf95a..da2a5fe 100644 --- a/inference-engine/ie_bridges/python/sample/classification_sample_async/classification_sample_async.py +++ b/inference-engine/ie_bridges/python/sample/classification_sample_async/classification_sample_async.py @@ -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" diff --git a/inference-engine/ie_bridges/python/sample/object_detection_sample_ssd/object_detection_sample_ssd.py b/inference-engine/ie_bridges/python/sample/object_detection_sample_ssd/object_detection_sample_ssd.py index 862abe4..64ef7aa 100644 --- a/inference-engine/ie_bridges/python/sample/object_detection_sample_ssd/object_detection_sample_ssd.py +++ b/inference-engine/ie_bridges/python/sample/object_detection_sample_ssd/object_detection_sample_ssd.py @@ -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 -------------------------------------------- diff --git a/inference-engine/ie_bridges/python/sample/style_transfer_sample/style_transfer_sample.py b/inference-engine/ie_bridges/python/sample/style_transfer_sample/style_transfer_sample.py index f6c8bd0..9531aba 100644 --- a/inference-engine/ie_bridges/python/sample/style_transfer_sample/style_transfer_sample.py +++ b/inference-engine/ie_bridges/python/sample/style_transfer_sample/style_transfer_sample.py @@ -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"