in utils/tb_log_parser.py [0:0]
def update_loop(self):
self.update_all_avg()
if not self.update_needed():
# print(" no update needed")
return
i = 0
with open(self.train_log, "r") as f:
for i, line in enumerate(f):
if i <= self.last_update_line:
continue
# print("processing line ",i, self.train_log)
if "--devices" in line:
self.gpus = 0
words = line.split()
for w in words[words.index("--devices") + 1 :]:
try:
int(w)
except: # noqa: E722
break
self.gpus += 1
elif "] Ep. " in line and "[valid]" not in line:
self.parse_train(line)
elif "[valid]" in line:
self.parse_valid(line)
self.last_update_line = i
print("last line id:", self.last_update_line)
self.save_last_update()