From 0b31c9e700b37f6e1491d9cf8825baa09539700c Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 16 Jan 2023 17:30:20 +0000 Subject: [PATCH] log start time, end time, and elapsed just in case...! --- aimodel/src/deeplabv3_plus_test_rainfall.py | 5 +++++ aimodel/src/index.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/aimodel/src/deeplabv3_plus_test_rainfall.py b/aimodel/src/deeplabv3_plus_test_rainfall.py index 1d733cd..410367a 100755 --- a/aimodel/src/deeplabv3_plus_test_rainfall.py +++ b/aimodel/src/deeplabv3_plus_test_rainfall.py @@ -19,6 +19,9 @@ import tensorflow as tf from lib.dataset.dataset_mono import dataset_mono from lib.ai.components.LossCrossEntropyDice import LossCrossEntropyDice +time_start = datetime.now() +logger.info(f"Starting at {str(datetime.now().isoformat())}") + IMAGE_SIZE = int(os.environ["IMAGE_SIZE"]) if "IMAGE_SIZE" in os.environ else 128 # was 512; 128 is the highest power of 2 that fits the data BATCH_SIZE = int(os.environ["BATCH_SIZE"]) if "BATCH_SIZE" in os.environ else 64 NUM_CLASSES = 2 @@ -317,3 +320,5 @@ plot_predictions( colormap, model=model ) + +logger.info(f"Complete at {str(datetime.now().isoformat())}, elapsed {str((datetime.now() - time_start).total_seconds())} seconds") diff --git a/aimodel/src/index.py b/aimodel/src/index.py index 8c3d8cb..7298496 100755 --- a/aimodel/src/index.py +++ b/aimodel/src/index.py @@ -2,6 +2,7 @@ import importlib import sys +from datetime import datetime from loguru import logger @@ -15,9 +16,15 @@ def main(): if args == None: return + time_start = datetime.utcnow() + logger.info(f"Time: Starting subcommand {subcommand} at {str(datetime.utcnow().isoformat())}") + imported_module = importlib.import_module(f"subcommands.{subcommand}") imported_module.run(args) + logger.info(f"*** complete in {str((datetime.now() - time_start).total_seconds())} seconds ***") + + if __name__ == "__main__": main()