From a18fb6d6ececfa53a563c6b45cd7c65cba3046fc Mon Sep 17 00:00:00 2001 From: Ben Hoff Date: Tue, 8 Oct 2019 12:05:18 -0400 Subject: [PATCH] add robust JSON handeling for auto annotation runner (#758) --- utils/auto_annotation/run_model.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/auto_annotation/run_model.py b/utils/auto_annotation/run_model.py index 8aedf1c5c..d45ce594a 100644 --- a/utils/auto_annotation/run_model.py +++ b/utils/auto_annotation/run_model.py @@ -70,7 +70,11 @@ def main(): return with open(mapping_file) as json_file: - mapping = json.load(json_file) + try: + mapping = json.load(json_file) + except json.decoder.JSONDecodeError: + logging.critical('JSON file not able to be parsed! Check file') + return try: mapping = mapping['label_map'] -- GitLab