Skip to content

Commit 76d3d72

Browse files
authored
Merge pull request tensorflow#4822 from buckman-google/master
Fixed minor bug in STEVE which sometimes prevented resuming experiments.
2 parents 2689c9a + c1da1ae commit 76d3d72

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

research/steve/learner.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ def _resume_from_checkpoint(self):
155155
self.resume_from_checkpoint(epoch)
156156

157157
def _log(self):
158-
logstring = "(%3.2f sec) h%-8.2f e%-8d s%-8d f%-8d\t" % (time.time() - self._log_time, self.hours, self.epoch, self.update_i + 1, self.total_frames) + ', '.join(["%8f" % x for x in (self.running_total / self.denom).tolist()])
159-
print("%s\t%s" % (self.learner_name, logstring))
160-
with open(self.log_path, "a") as f: f.write(logstring + "\n")
158+
if self.denom > 0:
159+
logstring = "(%3.2f sec) h%-8.2f e%-8d s%-8d f%-8d\t" % (time.time() - self._log_time, self.hours, self.epoch, self.update_i + 1, self.total_frames) + ', '.join(["%8f" % x for x in (self.running_total / self.denom).tolist()])
160+
print("%s\t%s" % (self.learner_name, logstring))
161+
with open(self.log_path, "a") as f: f.write(logstring + "\n")
161162
self._reset_inspections()
162163

163164
def _reset_inspections(self):

0 commit comments

Comments
 (0)