Apex and 'git pull' suggestions
This commit is contained in:
parent
b8c3644a18
commit
510eadcfa5
1
train.py
1
train.py
|
@ -13,6 +13,7 @@ mixed_precision = True
|
||||||
try: # Mixed precision training https://github.com/NVIDIA/apex
|
try: # Mixed precision training https://github.com/NVIDIA/apex
|
||||||
from apex import amp
|
from apex import amp
|
||||||
except:
|
except:
|
||||||
|
print('Apex recommended for mixed precision and faster training: https://github.com/NVIDIA/apex')
|
||||||
mixed_precision = False # not installed
|
mixed_precision = False # not installed
|
||||||
|
|
||||||
wdir = 'weights' + os.sep # weights dir
|
wdir = 'weights' + os.sep # weights dir
|
||||||
|
|
|
@ -3,6 +3,7 @@ import math
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import shutil
|
import shutil
|
||||||
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
|
@ -18,6 +19,11 @@ from . import torch_utils # , google_utils
|
||||||
|
|
||||||
matplotlib.rc('font', **{'size': 11})
|
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
|
# Set printoptions
|
||||||
torch.set_printoptions(linewidth=320, precision=5, profile='long')
|
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
|
np.set_printoptions(linewidth=320, formatter={'float_kind': '{:11.5g}'.format}) # format short g, %precision=5
|
||||||
|
|
Loading…
Reference in New Issue