def test_run_feed_dict(self):
p = self.create_plan(loom_input_tensor=None)
p.examples = [1] * 4
self.check_plan(p, [])
# Test that we don't clobber a better checkpoint with a worse one.
tf.reset_default_graph()
self._ClearCachedSession()
p = self.create_plan(loom_input_tensor=None)
p.examples = [1] * 4
p.epochs = 1
p._loss_total = tf.constant(42.0)
# We aren't using a managed session, so we need to run this ourselves.
init_op = tf.global_variables_initializer()
sv = p.create_supervisor()
with self.test_session() as sess:
sess.run(init_op)
p.run(sv, sess)
log_str = p.print_file.getvalue()
self.assertNotIn('new best model saved', log_str)
评论列表
文章目录