Commit d400b768 authored by Zhilin Yang's avatar Zhilin Yang Committed by GitHub
Browse files

Merge pull request #32 from lopuhin/fix-tpu-training

Fix training on the TPU in Colab
parents 79947372 98ece579
...@@ -3083,6 +3083,12 @@ class _CapturingContext(control_flow_ops.ControlFlowContext): ...@@ -3083,6 +3083,12 @@ class _CapturingContext(control_flow_ops.ControlFlowContext):
raise ValueError('{}: Op {} depends on TPU computation {}, ' raise ValueError('{}: Op {} depends on TPU computation {}, '
'which is not allowed.'.format(self._message, op, c)) 'which is not allowed.'.format(self._message, op, c))
def to_control_flow_context_def(self, context_def, export_scope=None):
# pylint: disable=useless-super-delegation
# NOTE(slebedev): the method is required by `ControlFlowContext`.
super(_CapturingContext, self).to_control_flow_context_def(
context_def, export_scope)
def __enter__(self): def __enter__(self):
# pylint: disable=protected-access # pylint: disable=protected-access
self._g = ops.get_default_graph() self._g = ops.get_default_graph()
......
...@@ -90,10 +90,6 @@ flags.DEFINE_integer("max_eval_batch", default=-1, ...@@ -90,10 +90,6 @@ flags.DEFINE_integer("max_eval_batch", default=-1,
help="Set -1 to turn off. Only used in test mode.") help="Set -1 to turn off. Only used in test mode.")
flags.DEFINE_bool("do_eval_only", default=False, flags.DEFINE_bool("do_eval_only", default=False,
help="Run evaluation only.") help="Run evaluation only.")
flags.DEFINE_string("eval_ckpt_path", None,
help="Checkpoint path for do_test evaluation."
"If set, model_dir will be ignored."
"If unset, will use the latest ckpt in model_dir.")
flags.DEFINE_integer("start_eval_steps", default=10000, flags.DEFINE_integer("start_eval_steps", default=10000,
help="Which checkpoint to start with in `do_eval_only` mode.") help="Which checkpoint to start with in `do_eval_only` mode.")
flags.DEFINE_string("eval_split", "valid", flags.DEFINE_string("eval_split", "valid",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment