From cb3c12bb3540a6f281c150cffb5b6ce98cd4dda5 Mon Sep 17 00:00:00 2001 From: franklin5 Date: Thu, 7 Aug 2025 13:16:08 -0700 Subject: [PATCH] Update callbacks.py AttributeError: 'Functional' object has no attribute '_distribution_strategy'. distribute_strategy is a property of the model --- tf_keras/callbacks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tf_keras/callbacks.py b/tf_keras/callbacks.py index 075418b1a..e7041d4c6 100644 --- a/tf_keras/callbacks.py +++ b/tf_keras/callbacks.py @@ -1894,7 +1894,7 @@ def on_train_begin(self, logs=None): # TrainingState is used to manage the training state needed for # failure-recovery of a worker in training. - if self.model._distribution_strategy and not isinstance( + if self.model.distribute_strategy and not isinstance( self.model.distribute_strategy, self._supported_strategies ): raise NotImplementedError(