Skip to content

Commit

Permalink
add robust JSON handeling for auto annotation runner (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoff authored and nmanovic committed Oct 8, 2019
1 parent a18e83b commit a18fb6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/auto_annotation/run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit a18fb6d

Please sign in to comment.