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
ee2a5435
Commit
ee2a5435
authored
Sep 10, 2021
by
Le Hou
Committed by
A. Unique TensorFlower
Sep 10, 2021
Browse files
Internal change
PiperOrigin-RevId: 395980073
parent
9db38a15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
official/common/streamz_counters.py
official/common/streamz_counters.py
+27
-0
official/modeling/fast_training/progressive/policies.py
official/modeling/fast_training/progressive/policies.py
+3
-7
No files found.
official/common/streamz_counters.py
0 → 100644
View file @
ee2a5435
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Global streamz counters."""
from
tensorflow.python.eager
import
monitoring
progressive_policy_creation_counter
=
monitoring
.
Counter
(
"/tensorflow/training/fast_training/progressive_policy_creation"
,
"Counter for the number of ProgressivePolicy creations."
)
stack_vars_to_vars_call_counter
=
monitoring
.
Counter
(
"/tensorflow/training/fast_training/tf_vars_to_vars"
,
"Counter for the number of low-level stacking API calls."
)
official/modeling/fast_training/progressive/policies.py
View file @
ee2a5435
...
...
@@ -25,16 +25,11 @@ from absl import logging
import
six
import
tensorflow
as
tf
from
tensorflow.python.eager
import
monitoring
from
official.common
import
streamz_counters
from
official.modeling.fast_training.progressive
import
utils
from
official.modeling.hyperparams
import
base_config
_progressive_policy_creation_counter
=
monitoring
.
Counter
(
'/tensorflow/training/fast_training/progressive_policy_creation'
,
'Counter for the number of ProgressivePolicy creations.'
)
@
dataclasses
.
dataclass
class
ProgressiveConfig
(
base_config
.
Config
):
pass
...
...
@@ -76,7 +71,8 @@ class ProgressivePolicy:
optimizer
=
self
.
get_optimizer
(
stage_id
),
model
=
self
.
get_model
(
stage_id
,
old_model
=
None
))
_progressive_policy_creation_counter
.
get_cell
().
increase_by
(
1
)
streamz_counters
.
progressive_policy_creation_counter
.
get_cell
(
).
increase_by
(
1
)
def
compute_stage_id
(
self
,
global_step
:
int
)
->
int
:
for
stage_id
in
range
(
self
.
num_stages
()):
...
...
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