From e835a4cf58a69d107f3162dc83d7de192efbf8e4 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Tue, 26 May 2020 07:44:25 +0300 Subject: [PATCH] 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. --- model-optimizer/mo/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model-optimizer/mo/main.py b/model-optimizer/mo/main.py index e1a8753..d180dec 100644 --- a/model-optimizer/mo/main.py +++ b/model-optimizer/mo/main.py @@ -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): -- 2.7.4