From a7a269ab7367bdac3b0abf37bf11c71d2852792e Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Mon, 29 Apr 2019 11:56:08 +0200 Subject: [PATCH] Fixed calculation of number of digits Signed-off-by: Jim Martens --- src/twomartens/masterthesis/data.py | 2 +- src/twomartens/masterthesis/main.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/twomartens/masterthesis/data.py b/src/twomartens/masterthesis/data.py index 790db3c..22c14ae 100644 --- a/src/twomartens/masterthesis/data.py +++ b/src/twomartens/masterthesis/data.py @@ -282,7 +282,7 @@ def load_scenenet_val(photo_paths: Sequence[Sequence[str]], dataset = dataset.batch(batch_size=batch_size) dataset = dataset.map(_load_images_ssd_callback(resized_shape)) - nr_digits = math.ceil((length_dataset * num_epochs) / batch_size) + nr_digits = math.ceil(math.log10(math.ceil((length_dataset * num_epochs) / batch_size))) return dataset, nr_digits diff --git a/src/twomartens/masterthesis/main.py b/src/twomartens/masterthesis/main.py index 11fbdb2..743fa5a 100644 --- a/src/twomartens/masterthesis/main.py +++ b/src/twomartens/masterthesis/main.py @@ -190,7 +190,6 @@ def _ssd_val(args: argparse.Namespace) -> None: scenenet_data, nr_digits = data.load_scenenet_val(file_names_photos, instances, args.coco_path, batch_size=batch_size, resized_shape=(image_size, image_size)) - print(nr_digits) use_summary_writer = summary_ops_v2.create_file_writer( f"{args.summary_path}/val/ssd/{args.iteration}" )