From 170c9e7dc80b8a4bd1fd0700995fa16dff156960 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 14 May 2022 18:14:09 +0200 Subject: [PATCH] Add Python version output --- utils/general.py | 2 +- utils/torch_utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/general.py b/utils/general.py index 2dc81ea1c49c..4b50b874c619 100755 --- a/utils/general.py +++ b/utils/general.py @@ -256,7 +256,7 @@ def file_age(path=__file__): return dt.days # + dt.seconds / 86400 # fractional days -def file_update_date(path=__file__): +def file_date(path=__file__): # Return human-readable file modification date, i.e. '2021-3-26' t = datetime.fromtimestamp(Path(path).stat().st_mtime) return f'{t.year}-{t.month}-{t.day}' diff --git a/utils/torch_utils.py b/utils/torch_utils.py index 72f8a0fd1659..ae712a3c5f77 100644 --- a/utils/torch_utils.py +++ b/utils/torch_utils.py @@ -18,7 +18,7 @@ import torch.nn as nn import torch.nn.functional as F -from utils.general import LOGGER, file_update_date, git_describe +from utils.general import LOGGER, file_date, git_describe try: import thop # for FLOPs computation @@ -51,7 +51,7 @@ def device_count(): def select_device(device='', batch_size=0, newline=True): # device = 'cpu' or '0' or '0,1,2,3' - s = f'YOLOv5 🚀 {git_describe() or file_update_date()} torch {torch.__version__} ' # string + s = f'YOLOv5 🚀 {git_describe() or file_date()} Python-{platform.python_version()} torch-{torch.__version__} ' device = str(device).strip().lower().replace('cuda:', '') # to string, 'cuda:0' to '0' cpu = device == 'cpu' if cpu: