diff --git a/tools/mo/openvino/tools/mo/convert_impl.py b/tools/mo/openvino/tools/mo/convert_impl.py index 3c5514d57fee9b..920746485eb7dd 100644 --- a/tools/mo/openvino/tools/mo/convert_impl.py +++ b/tools/mo/openvino/tools/mo/convert_impl.py @@ -820,6 +820,9 @@ def _convert(cli_parser: argparse.ArgumentParser, framework, args, python_api_us if 'help' in args and args['help']: show_mo_convert_help() return None, None + ovc_message = get_ovc_message() + if ovc_message is not None: + print(ovc_message) simplified_mo_version = VersionChecker().get_mo_simplified_version() telemetry = init_mo_telemetry() telemetry.start_session('mo') @@ -908,14 +911,11 @@ def _convert(cli_parser: argparse.ArgumentParser, framework, args, python_api_us ov_update_message = get_ov_update_message() ov_api20_message = get_ov_api20_message() - ovc_message = get_ovc_message() _, is_caffe, is_mxnet, is_kaldi, _ = deduce_legacy_frontend_by_namespace(argv) if ov_update_message is not None: print(ov_update_message) if ov_api20_message is not None and ov_model is not None: print(ov_api20_message) - if ovc_message is not None and not is_caffe and not is_mxnet and not is_kaldi: - print(ovc_message) is_fallback = getattr(argv, 'is_fallback', False) if not argv.use_legacy_frontend and framework_is_tf(args, argv) and not is_fallback: # now TF FE is default frontend for TensorFlow models conversion diff --git a/tools/mo/openvino/tools/mo/front/caffe/detection_output_ext.py b/tools/mo/openvino/tools/mo/front/caffe/detection_output_ext.py index b6d792c174b731..718a3aa82d0759 100644 --- a/tools/mo/openvino/tools/mo/front/caffe/detection_output_ext.py +++ b/tools/mo/openvino/tools/mo/front/caffe/detection_output_ext.py @@ -94,9 +94,9 @@ def extract(cls, node): 'visualize_threshold': visualize_threshold, 'save_file': param.save_file, # nms_param - 'nms_threshold': nms_threshold, - 'top_k': top_k, - 'eta': eta, + 'nms_threshold': nms_threshold, # pylint: disable=possibly-used-before-assignment + 'top_k': top_k, # pylint: disable=possibly-used-before-assignment + 'eta': eta, # pylint: disable=possibly-used-before-assignment # save_output_param 'output_directory': param.save_output_param.output_directory, 'output_name_prefix': param.save_output_param.output_name_prefix, @@ -111,7 +111,7 @@ def extract(cls, node): 'width': param.save_output_param.resize_param.width, 'height_scale': param.save_output_param.resize_param.height_scale, 'width_scale': param.save_output_param.resize_param.width_scale, - 'pad_mode': pad_mode, + 'pad_mode': pad_mode, # pylint: disable=possibly-used-before-assignment 'pad_value': ','.join(str(x) for x in param.save_output_param.resize_param.pad_value), 'interp_mode': interp_mode, } diff --git a/tools/mo/openvino/tools/mo/front/kaldi/extractors/convolutional_1d_component_ext.py b/tools/mo/openvino/tools/mo/front/kaldi/extractors/convolutional_1d_component_ext.py index 73ad0b2fd2e42a..9c07d7271bafe3 100644 --- a/tools/mo/openvino/tools/mo/front/kaldi/extractors/convolutional_1d_component_ext.py +++ b/tools/mo/openvino/tools/mo/front/kaldi/extractors/convolutional_1d_component_ext.py @@ -69,7 +69,7 @@ def extract(cls, node: Node) -> bool: 'kernel_spatial_idx': [2, 3], 'group': 1, 'reshape_kernel': True, - 'appended_conv': appended_conv + 'appended_conv': appended_conv # pylint: disable=possibly-used-before-assignment } mapping_rule.update(layout_attrs()) diff --git a/tools/mo/openvino/tools/mo/front/kaldi/replace_lstm_nonlinearity.py b/tools/mo/openvino/tools/mo/front/kaldi/replace_lstm_nonlinearity.py index 95a4eaa43d691b..0ea34132ddeac5 100644 --- a/tools/mo/openvino/tools/mo/front/kaldi/replace_lstm_nonlinearity.py +++ b/tools/mo/openvino/tools/mo/front/kaldi/replace_lstm_nonlinearity.py @@ -71,7 +71,7 @@ def replace_op(self, graph: Graph, node: Node): if node['use_dropout']: mul_dropout_i = Mul(graph, {'name': split_node.soft_get('name', split_node.id) + '/mul_i'}).create_node() mul_dropout_i.in_port(0).connect(i_sigmoid.out_port(0)) - mul_dropout_i.in_port(1).connect(i_drop_scale) + mul_dropout_i.in_port(1).connect(i_drop_scale) # pylint: disable=possibly-used-before-assignment i_sigmoid = mul_dropout_i # f_t = Sigmoid(f_part + w_fc*ct_1) @@ -91,7 +91,7 @@ def replace_op(self, graph: Graph, node: Node): if node['use_dropout']: mul_dropout_f = Mul(graph, {'name': split_node.soft_get('name', split_node.id) + '/mul_f'}).create_node() mul_dropout_f.in_port(0).connect(f_sigmoid.out_port(0)) - mul_dropout_f.in_port(1).connect(f_drop_scale) + mul_dropout_f.in_port(1).connect(f_drop_scale) # pylint: disable=possibly-used-before-assignment f_sigmoid = mul_dropout_f # c_t = f_t*ct_1 + i_t * tanh(c_part) @@ -127,7 +127,7 @@ def replace_op(self, graph: Graph, node: Node): if node['use_dropout']: mul_dropout_o = Mul(graph, {'name': split_node.soft_get('name', split_node.id) + '/mul_o'}).create_node() mul_dropout_o.in_port(0).connect(o_sigmoid.out_port(0)) - mul_dropout_o.in_port(1).connect(o_drop_scale) + mul_dropout_o.in_port(1).connect(o_drop_scale) # pylint: disable=possibly-used-before-assignment o_sigmoid = mul_dropout_o # m_t = o_t * Tanh(c_t) diff --git a/tools/mo/openvino/tools/mo/middle/MXNetSplitMultiLayers.py b/tools/mo/openvino/tools/mo/middle/MXNetSplitMultiLayers.py index 9876da7dd68520..d4a8fe0a23f855 100644 --- a/tools/mo/openvino/tools/mo/middle/MXNetSplitMultiLayers.py +++ b/tools/mo/openvino/tools/mo/middle/MXNetSplitMultiLayers.py @@ -106,7 +106,7 @@ def split_multilayer_cell(self, graph: Graph, match: dict): ).create_node_with_data() if have_hidden: - layer_hidden_state = hidden_state_value[l * direction: l * direction + direction] + layer_hidden_state = hidden_state_value[l * direction: l * direction + direction] # pylint: disable=possibly-used-before-assignment hidden_state_value_node = Const( rnn_layer.graph, dict(name=name + '/LayerSplittedHiddenState/{}/'.format(l), value=layer_hidden_state) @@ -115,7 +115,7 @@ def split_multilayer_cell(self, graph: Graph, match: dict): hidden_state_value_node = None if have_cell: - layer_cell_state = cell_state_value[l * direction: l * direction + direction] + layer_cell_state = cell_state_value[l * direction: l * direction + direction] # pylint: disable=possibly-used-before-assignment cell_state_value_node = Const( rnn_layer.graph, dict(name=name + '/LayerSplittedCellState/{}/'.format(l), value=layer_cell_state) diff --git a/tools/mo/openvino/tools/mo/middle/StridedSliceNormalizer.py b/tools/mo/openvino/tools/mo/middle/StridedSliceNormalizer.py index 942de545e9abab..75d05a9b5148fe 100644 --- a/tools/mo/openvino/tools/mo/middle/StridedSliceNormalizer.py +++ b/tools/mo/openvino/tools/mo/middle/StridedSliceNormalizer.py @@ -154,7 +154,7 @@ def normalize_strided_slice(graph: Graph, node: Node): if num_insertions > 0: # insert blank values for ellipsis unrolling and extending for mask_name in StridedSlice.get_mask_names(): - node[mask_name] = np.insert(node[mask_name], insertion_start_idx, [0] * num_insertions).astype(int) + node[mask_name] = np.insert(node[mask_name], insertion_start_idx, [0] * num_insertions).astype(int) # pylint: disable=possibly-used-before-assignment @staticmethod def unroll_ellipsis_for_inputs(graph: Graph, node: Node, ellipsis_start: int, num_insertions: int): diff --git a/tools/mo/openvino/tools/mo/ops/one_hot.py b/tools/mo/openvino/tools/mo/ops/one_hot.py index 808f2fd5abecb2..f9885bdfdfa2d2 100644 --- a/tools/mo/openvino/tools/mo/ops/one_hot.py +++ b/tools/mo/openvino/tools/mo/ops/one_hot.py @@ -74,7 +74,7 @@ def infer(node: Node): hot_idx = *idx, indices[idx] if -depth <= indices[idx] < depth: - onehot_value[hot_idx] = on_value + onehot_value[hot_idx] = on_value # pylint: disable=possibly-used-before-assignment node.out_port(0).data.set_value(onehot_value) diff --git a/tools/mo/openvino/tools/mo/utils/get_ov_update_message.py b/tools/mo/openvino/tools/mo/utils/get_ov_update_message.py index e3b30947c30e99..84a77b1adde082 100644 --- a/tools/mo/openvino/tools/mo/utils/get_ov_update_message.py +++ b/tools/mo/openvino/tools/mo/utils/get_ov_update_message.py @@ -51,8 +51,9 @@ def get_try_legacy_fe_message(): def get_ovc_message(): link = "https://docs.openvino.ai/2023.2/openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition.html" - message = '[ INFO ] MO command line tool is considered as the legacy conversion API as of OpenVINO 2023.2 release. ' \ - 'Please use OpenVINO Model Converter (OVC). ' \ + message = '[ INFO ] MO command line tool is considered as the legacy conversion API as of OpenVINO 2023.2 release.\n' \ + 'In 2025.0 MO command line tool and openvino.tools.mo.convert_model() will be removed. ' \ + 'Please use OpenVINO Model Converter (OVC) or openvino.convert_model(). ' \ 'OVC represents a lightweight alternative of MO and provides simplified model conversion API. \n' \ 'Find more information about transition from MO to OVC at {}'.format(link) diff --git a/tools/mo/openvino/tools/mo/utils/logger.py b/tools/mo/openvino/tools/mo/utils/logger.py index 643d4d89191312..fbc75c6c2ca36a 100644 --- a/tools/mo/openvino/tools/mo/utils/logger.py +++ b/tools/mo/openvino/tools/mo/utils/logger.py @@ -14,7 +14,7 @@ if importlib.util.find_spec('absl') is not None: import absl.logging - log.root.removeHandler(absl.logging._absl_handler) + log.root.removeHandler(absl.logging._absl_handler) # pylint: disable=c-extension-no-member handler_num = 0