Fixed verbose param. (#21234)

This commit is contained in:
Anastasiia Pnevskaia 2023-11-22 14:32:20 +01:00 committed by GitHub
parent 309539667a
commit 823d327476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -40,6 +40,8 @@ def generate_ir_ovc(coverage=False, **kwargs):
# if we omit this argument for FP32, it will be set implicitly to True as the default
elif key == 'compress_to_fp16':
params.append("--{}={}".format(key, value))
elif key == 'verbose':
params.append("--{}".format(key))
elif isinstance(value, bool) and value:
params.append("--{}".format(key))
elif isinstance(value, bool) and not value:
@ -176,3 +178,17 @@ class TestOVCTool(unittest.TestCase):
ov_model = core.read_model(os.path.join(self.tmp_dir, "dir", "test_model.xml"))
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg
def test_ovc_tool_verbose(self):
from openvino.runtime import Core
core = Core()
model_dir, ref_model = self.create_tf_saved_model_dir(self.tmp_dir)
exit_code, stderr = generate_ir_ovc(coverage=False, **{"input_model": model_dir, "output_model": self.tmp_dir, "verbose": ""})
assert not exit_code
ov_model = core.read_model(os.path.join(self.tmp_dir, "test_model.xml"))
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg

View File

@ -575,10 +575,12 @@ def get_model_name_from_args(argv: argparse.Namespace):
raise Error('The directory "{}" is not writable'.format(argv.output_model))
output_dir = argv.output_model
input_model = os.path.abspath(argv.input_model)
input_model = argv.input_model
if isinstance(input_model, (tuple, list)) and len(input_model) > 0:
input_model = input_model[0]
input_model = os.path.abspath(input_model)
if not isinstance(input_model, (str, pathlib.Path)):
return output_dir