add warning to plot_results()

This commit is contained in:
Glenn Jocher 2020-04-11 11:04:10 -07:00
parent 7be71b02e2
commit b574f765ce
1 changed files with 15 additions and 12 deletions

View File

@ -966,6 +966,7 @@ def plot_results(start=0, stop=0, bucket='', id=()): # from utils.utils import
else: else:
files = glob.glob('results*.txt') + glob.glob('../../Downloads/results*.txt') files = glob.glob('results*.txt') + glob.glob('../../Downloads/results*.txt')
for f in sorted(files): for f in sorted(files):
try:
results = np.loadtxt(f, usecols=[2, 3, 4, 8, 9, 12, 13, 14, 10, 11], ndmin=2).T results = np.loadtxt(f, usecols=[2, 3, 4, 8, 9, 12, 13, 14, 10, 11], ndmin=2).T
n = results.shape[1] # number of rows n = results.shape[1] # number of rows
x = range(start, min(stop, n) if stop else n) x = range(start, min(stop, n) if stop else n)
@ -978,6 +979,8 @@ def plot_results(start=0, stop=0, bucket='', id=()): # from utils.utils import
ax[i].set_title(s[i]) ax[i].set_title(s[i])
if i in [5, 6, 7]: # share train and val loss y axes if i in [5, 6, 7]: # share train and val loss y axes
ax[i].get_shared_y_axes().join(ax[i], ax[i - 5]) ax[i].get_shared_y_axes().join(ax[i], ax[i - 5])
except:
print('Warning: Plotting error for %s, skipping file' % f)
fig.tight_layout() fig.tight_layout()
ax[1].legend() ax[1].legend()