Skip to content

Commit 10f00bd

Browse files
committed
Add tf.enable_resource_variables() to other run scripts.
1 parent 5b24223 commit 10f00bd

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎TensorFlow/LanguageModeling/BERT/run_classifier.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ def main(_):
488488
training_hooks.append(hvd.BroadcastGlobalVariablesHook(0))
489489
if FLAGS.use_xla:
490490
config.graph_options.optimizer_options.global_jit_level = tf.compat.v1.OptimizerOptions.ON_1
491+
tf.enable_resource_variables()
491492

492493
run_config = tf.estimator.RunConfig(
493494
model_dir=FLAGS.output_dir if master_process else None,

‎TensorFlow/LanguageModeling/BERT/run_ner.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ def main(_):
668668

669669
if FLAGS.use_xla:
670670
config.graph_options.optimizer_options.global_jit_level = tf.compat.v1.OptimizerOptions.ON_1
671+
tf.enable_resource_variables()
671672
run_config = tf.estimator.RunConfig(
672673
model_dir=FLAGS.output_dir if master_process else None,
673674
session_config=config,

‎TensorFlow/LanguageModeling/BERT/run_pretraining.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ def main(_):
584584
if FLAGS.use_xla:
585585
config.graph_options.optimizer_options.global_jit_level = tf.compat.v1.OptimizerOptions.ON_1
586586
config.graph_options.rewrite_options.memory_optimization = rewriter_config_pb2.RewriterConfig.NO_MEM_OPT
587+
tf.enable_resource_variables()
587588

588589
run_config = tf.estimator.RunConfig(
589590
model_dir=FLAGS.output_dir,

‎TensorFlow/LanguageModeling/BERT/run_re.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ def main(_):
779779

780780
if FLAGS.use_xla:
781781
config.graph_options.optimizer_options.global_jit_level = tf.compat.v1.OptimizerOptions.ON_1
782+
tf.enable_resource_variables()
782783
run_config = tf.estimator.RunConfig(
783784
model_dir=FLAGS.output_dir if master_process else None,
784785
session_config=config,

0 commit comments

Comments
 (0)