Made MO deprecation message more explicit. (#24512)

### Details:
 - Made MO deprecation message more explicit.
 - PyLint fixes

### Tickets:
 -
This commit is contained in:
Anastasiia Pnevskaia 2024-05-15 13:56:55 +02:00 committed by GitHub
parent eb1eb22931
commit 836dcf5efc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 19 additions and 18 deletions

View File

@ -817,6 +817,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')
@ -904,12 +907,9 @@ def _convert(cli_parser: argparse.ArgumentParser, framework, args, python_api_us
print(get_compression_message())
ov_update_message = get_ov_update_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 ovc_message is not None and not is_caffe and not is_mxnet and not is_kaldi:
print(ovc_message)
send_conversion_result('success')
return ov_model, argv

View File

@ -94,9 +94,9 @@ class DetectionOutputFrontExtractor(FrontExtractorOp):
'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 @@ class DetectionOutputFrontExtractor(FrontExtractorOp):
'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,
}

View File

@ -69,7 +69,7 @@ class ConvolutionalComponentFrontExtractor(FrontExtractorOp):
'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())

View File

@ -71,7 +71,7 @@ class ReplaceLstmNonLinearityPattern(FrontReplacementOp):
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 @@ class ReplaceLstmNonLinearityPattern(FrontReplacementOp):
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 @@ class ReplaceLstmNonLinearityPattern(FrontReplacementOp):
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)

View File

@ -106,7 +106,7 @@ class MXNetSplitLayersToRNNSequence(MiddleReplacementPattern):
).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 @@ class MXNetSplitLayersToRNNSequence(MiddleReplacementPattern):
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)

View File

@ -154,7 +154,7 @@ class StridedSliceNormalizer(MiddleReplacementPattern):
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):

View File

@ -74,7 +74,7 @@ class OneHot(Op):
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)

View File

@ -32,8 +32,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)

View File

@ -14,7 +14,7 @@ from copy import copy
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