-
Notifications
You must be signed in to change notification settings - Fork 1
/
print.py
40 lines (40 loc) · 1.02 KB
/
print.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
import numpy as np
loss_list = []
step_list = []
filename = sys.argv[1];
max_top1 = 0.0
max_top5 = 0.0
config1 = ''
config2 = ''
config3 = ''
with open(filename) as f:
for line in f:
if "learning" in line:
config1 = line
if "warmup" in line:
config2 = line
if "weight_decay" in line:
config3 = line
if "Saving dict" in line:
#print(line)
a = line.replace(',', '')
#b = a.replace(']', ' ')
#print(b)
mystr = a.split();
top1 = float(mystr[-1])
top5 = float(mystr[-4])
if top1 > max_top1:
print(config1)
print(config2)
print(config3)
print(line)
max_top1 = top1
if top5 > max_top5:
print(config1)
print(config2)
print(config3)
print(line)
max_top5 = top5
#print(loss_list)
#print(step_list)