Skip to content

Commit 078e8d3

Browse files
pichuancopybara-github
authored andcommitted
Change the tf-models-official to avoid a class conflict.
PiperOrigin-RevId: 698999199
1 parent 5dc070b commit 078e8d3

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

deepvariant/dv_config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ def get_config(config_name: str) -> ml_collections.ConfigDict:
360360
# Stop training when this many consecutive evaluations yield no improvement.
361361
config.early_stopping_patience = 250
362362

363-
# Weight decay of optimizer
363+
# Optimizer params
364364
config.optimizer_weight_decay = 0.0
365+
config.ema_momentum = 0.99
365366

366367
# An 'iter' refers to a group of train/tune steps run in succession.
367368
config.steps_per_iter = 128

deepvariant/train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from deepvariant import keras_modeling
5050
from official.modeling import optimization
5151

52-
_CHECKPOINT_OPTIONS = tf.train.CheckpointOptions(enable_async=True)
52+
_CHECKPOINT_OPTIONS = tf.train.CheckpointOptions()
5353

5454
_LEADER = flags.DEFINE_string(
5555
'leader',

run-prereq.sh

+9
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,15 @@ sudo -H NEEDRESTART_MODE=a apt-get install "${APT_ARGS[@]}" libssl-dev libcurl4-
289289
# for the debruijn graph
290290
sudo -H NEEDRESTART_MODE=a apt-get install "${APT_ARGS[@]}" libboost-graph-dev > /dev/null
291291

292+
# Pin tf-models-official back to 2.11.6 to be closer to
293+
# ${DV_GCP_OPTIMIZED_TF_WHL_VERSION} (which is 2.11.0).
294+
# This is to avoid the issue:
295+
# ValueError: Addons>LAMB has already been registered to <class 'tensorflow_addons.optimizers.lamb.LAMB'>
296+
# However, it's important that the protobuf pinning happens after this!
297+
# TODO: Remove this later once the first dependency can be changed
298+
# to ${DV_GCP_OPTIMIZED_TF_WHL_VERSION}.
299+
pip3 install "${PIP_ARGS[@]}" "tf-models-official==2.11.6"
300+
292301
# Just being safe, pin protobuf's version one more time.
293302
pip3 install "${PIP_ARGS[@]}" 'protobuf==3.13.0'
294303

0 commit comments

Comments
 (0)