diff --git a/train.py b/train.py index 71dcbb05..7ca006b9 100644 --- a/train.py +++ b/train.py @@ -13,6 +13,7 @@ mixed_precision = True try: # Mixed precision training https://github.com/NVIDIA/apex from apex import amp except: + print('Apex recommended for mixed precision and faster training: https://github.com/NVIDIA/apex') mixed_precision = False # not installed wdir = 'weights' + os.sep # weights dir diff --git a/utils/utils.py b/utils/utils.py index d45d14cd..adda3dcb 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -3,6 +3,7 @@ import math import os import random import shutil +import subprocess from pathlib import Path import cv2 @@ -18,6 +19,11 @@ from . import torch_utils # , google_utils matplotlib.rc('font', **{'size': 11}) +# Suggest 'git pull' +s = subprocess.check_output('git status -uno', shell=True).decode('utf-8') +if 'Your branch is behind' in s: + print(s[s.find('Your branch is behind'):s.find('\n\n')] + '\n') + # Set printoptions torch.set_printoptions(linewidth=320, precision=5, profile='long') np.set_printoptions(linewidth=320, formatter={'float_kind': '{:11.5g}'.format}) # format short g, %precision=5