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
ModelZoo
ResNet50_tensorflow
Commits
31bb92df
Commit
31bb92df
authored
Aug 13, 2020
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 326396920
parent
88253ce5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
official/utils/misc/keras_utils.py
official/utils/misc/keras_utils.py
+6
-0
No files found.
official/utils/misc/keras_utils.py
View file @
31bb92df
...
...
@@ -30,6 +30,10 @@ from tensorflow.python.eager import monitoring
global_batch_size_gauge
=
monitoring
.
IntGauge
(
'/tensorflow/training/global_batch_size'
,
'TF training global batch size'
)
first_batch_start_time
=
monitoring
.
IntGauge
(
'/tensorflow/training/first_batch_start'
,
'TF training start time (unix epoch time in us.'
)
class
BatchTimestamp
(
object
):
"""A structure to store batch time stamp."""
...
...
@@ -117,6 +121,8 @@ class TimeHistory(tf.keras.callbacks.Callback):
def
on_batch_begin
(
self
,
batch
,
logs
=
None
):
if
not
self
.
start_time
:
self
.
start_time
=
time
.
time
()
if
not
first_batch_start_time
.
get_cell
().
value
():
first_batch_start_time
.
get_cell
().
set
(
int
(
self
.
start_time
*
1000000
))
# Record the timestamp of the first global step
if
not
self
.
timestamp_log
:
...
...
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