File tree Expand file tree Collapse file tree
TensorFlow/LanguageModeling/BERT Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments