# 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"
# 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"
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 --------------------------------------------
# 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"