From 8002b13fb5ab44445c2a82964f1147dc237d85e1 Mon Sep 17 00:00:00 2001
From: Neta Zmora <neta.zmora@intel.com>
Date: Mon, 2 Dec 2019 18:28:09 +0200
Subject: [PATCH] object detection: fix model summary generation

When multi-processing, we want only one process to generate the
summary, while the other processes do nothing (lazy bums!)
---
 examples/object_detection_compression/compress_detector.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 examples/object_detection_compression/compress_detector.py

diff --git a/examples/object_detection_compression/compress_detector.py b/examples/object_detection_compression/compress_detector.py
old mode 100644
new mode 100755
index 4f477c3..07718a6
--- a/examples/object_detection_compression/compress_detector.py
+++ b/examples/object_detection_compression/compress_detector.py
@@ -145,9 +145,10 @@ def main(args):
     patch_fastrcnn(model)
     model.to(device)
 
-    if args.summary and utils.is_main_process():
-        for summary in args.summary:
-            distiller.model_summary(model, summary, args.dataset)
+    if args.summary:
+        if utils.is_main_process():
+            for summary in args.summary:
+                distiller.model_summary(model, summary, args.dataset)
         return
 
     model_without_ddp = model
-- 
GitLab