Unverified Commit 21a4ad75 authored by guptapriya's avatar guptapriya Committed by GitHub
Browse files

Remove isintance change for contrib strategy (#6250)

* Remove isintance change for contrib strategy

Replace it with class name check instead which should work regardless

* Add quotes for string

* fix quote type
parent 5f4d34fc
...@@ -554,8 +554,8 @@ def resnet_main( ...@@ -554,8 +554,8 @@ def resnet_main(
train_epochs = (0 if flags_obj.eval_only or not flags_obj.train_epochs else train_epochs = (0 if flags_obj.eval_only or not flags_obj.train_epochs else
flags_obj.train_epochs) flags_obj.train_epochs)
use_train_and_evaluate = flags_obj.use_train_and_evaluate or isinstance( use_train_and_evaluate = flags_obj.use_train_and_evaluate or (
distribution_strategy, tf.contrib.distribute.CollectiveAllReduceStrategy) distribution_strategy.__class__.__name__ == 'CollectiveAllReduceStrategy')
if use_train_and_evaluate: if use_train_and_evaluate:
train_spec = tf.estimator.TrainSpec( train_spec = tf.estimator.TrainSpec(
input_fn=lambda: input_fn_train(train_epochs), hooks=train_hooks, input_fn=lambda: input_fn_train(train_epochs), hooks=train_hooks,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment