Error messages correcting in MO extractor (#15783)

* Error messages correcting.

* Error messages correcting.

* Small corrections.
This commit is contained in:
Anastasiia Pnevskaia 2023-02-20 15:20:54 +01:00 committed by GitHub
parent bc8d0ec71e
commit c8c4503672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,11 +236,13 @@ def fe_input_user_data_repack(
# NOTE: the logic relies on parameters with the single name
model_inputs = input_model.get_inputs()
frozen_names = freeze_placeholder.keys()
assert len(model_inputs) == len(frozen_names) + 1, "Please check the conversion command-line. " \
"Total number of model inputs must match to a number " \
"of input shapes along with frozen inputs."
assert len(model_inputs) == len(frozen_names) + 1, \
"Please check the conversion command-line. Total number of model inputs ({} detected) " \
"must match to a number of input shapes along with frozen inputs ({} in total).".format(
len(model_inputs),
len(frozen_names) + 1)
for node in model_inputs:
assert len(node.get_names()) > 0, "Original input models must have names."
assert len(node.get_names()) > 0, "Original model inputs must have tensor names."
input_name = node.get_names()[0]
if input_name not in frozen_names:
_input_shapes.append(
@ -258,7 +260,7 @@ def fe_input_user_data_repack(
# NOTE: the logic relies on parameters with the single name
assert input_user_shapes is None
for node in input_model.get_inputs():
assert len(node.get_names()) > 0, "Original input models must have names."
assert len(node.get_names()) > 0, "Original model inputs must have tensor names."
input_name = node.get_names()[0]
_input_shapes.append(
{