From c58550cf9a5bb0fcc253bfa75e50c54e6cf19651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Sch=C3=A4fer?= Date: Fri, 24 May 2019 14:09:35 +0300 Subject: [PATCH] minor fix: incorrect assert string message formatting (#631) * do not split strings so that format() works as expected * address flake8 indentation issue --- .gitignore | 3 +++ maskrcnn_benchmark/data/build.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4124b2bf1..d52f92b83 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ dist/ # Pycharm editor settings .idea +# MacOS +.DS_Store + # project dirs /datasets /models diff --git a/maskrcnn_benchmark/data/build.py b/maskrcnn_benchmark/data/build.py index 7572fd335..b0ce3c348 100644 --- a/maskrcnn_benchmark/data/build.py +++ b/maskrcnn_benchmark/data/build.py @@ -110,8 +110,8 @@ def make_data_loader(cfg, is_train=True, is_distributed=False, start_iter=0): images_per_batch = cfg.SOLVER.IMS_PER_BATCH assert ( images_per_batch % num_gpus == 0 - ), "SOLVER.IMS_PER_BATCH ({}) must be divisible by the number " - "of GPUs ({}) used.".format(images_per_batch, num_gpus) + ), "SOLVER.IMS_PER_BATCH ({}) must be divisible by the number of GPUs ({}) used.".format( + images_per_batch, num_gpus) images_per_gpu = images_per_batch // num_gpus shuffle = True num_iters = cfg.SOLVER.MAX_ITER @@ -119,8 +119,8 @@ def make_data_loader(cfg, is_train=True, is_distributed=False, start_iter=0): images_per_batch = cfg.TEST.IMS_PER_BATCH assert ( images_per_batch % num_gpus == 0 - ), "TEST.IMS_PER_BATCH ({}) must be divisible by the number " - "of GPUs ({}) used.".format(images_per_batch, num_gpus) + ), "TEST.IMS_PER_BATCH ({}) must be divisible by the number of GPUs ({}) used.".format( + images_per_batch, num_gpus) images_per_gpu = images_per_batch // num_gpus shuffle = False if not is_distributed else True num_iters = None