I notice that this code cannot work since June 14 as it says: 'Model' object has no attribute 'target_tensors'.
I change another way to use the TPU distribution strategy following https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/guide/distribute_strategy.ipynb#scrollTo=eQ1QESxxEbCh
But in this way, I need to set a validation_fre parameter, which significantly slows down the overall training process. How could I deal with that problem?
resolver = tf.contrib.cluster_resolver.TPUClusterResolver('grpc://' + os.environ['COLAB_TPU_ADDR'])
tf.contrib.distribute.initialize_tpu_system(resolver)
strategy = tf.contrib.distribute.TPUStrategy(resolver)
with strategy.scope():
model=myKerasmodel()
model.compile()....