Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
FastMoE
Commits
d400b768
Commit
d400b768
authored
Feb 18, 2019
by
Zhilin Yang
Committed by
GitHub
Feb 18, 2019
Browse files
Merge pull request #32 from lopuhin/fix-tpu-training
Fix training on the TPU in Colab
parents
79947372
98ece579
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
tf/tpu_estimator.py
tf/tpu_estimator.py
+6
-0
tf/train.py
tf/train.py
+0
-4
No files found.
tf/tpu_estimator.py
View file @
d400b768
...
@@ -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
()
...
...
tf/train.py
View file @
d400b768
...
@@ -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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment