MO: Flush after dumping the arguments to stdout (#570)

When stdout is not a terminal, Python will buffer it by default. This
means that a consumer of MO's output will not see the argument information
until the buffer is flushed, which will normally only happen once MO
finishes (which might take a while).

Flushing stdout explicitly allows the consumer to see this info as soon
as it's printed.
This commit is contained in:
Roman Donchenko 2020-05-26 07:44:25 +03:00 committed by GitHub
parent d3923f2ce0
commit e835a4cf58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ def print_argv(argv: argparse.Namespace, is_caffe: bool, is_tf: bool, is_mxnet:
continue
lines.append('\t{}: \t{}'.format(desc, getattr(argv, op, 'NONE')))
lines.append('Model Optimizer version: \t{}'.format(get_version()))
print('\n'.join(lines))
print('\n'.join(lines), flush=True)
def prepare_ir(argv: argparse.Namespace):