Hi,
thanks for your work.
i get AttributeError: 'Model' object has no attribute '_distribution_strategy'
i figure it has to do with keras and tf, but i'm unable to find a way.
Best,
xxtu
AttributeError Traceback (most recent call last)
in
20
21 # Find all the faces in the current frame of video
---> 22 face_locations = detect_face(rgb_frame)
23
24 # Display the results
in detect_face(img)
28
29 # create predictions
---> 30 sex_preds = sex_model.predict(center_img.reshape(1,224,224,3))[0][0]
31 age_preds = age_model.predict(center_img.reshape(1,224,224,3))[0][0]
32
~/.pyenv/versions/3.8.7/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in predict(self, x, batch_size, verbose, steps, callbacks, max_queue_size, workers, use_multiprocessing)
1580
1581 outputs = None
-> 1582 with self.distribute_strategy.scope():
1583 # Creates a tf.data.Dataset
and handles batch and epoch iteration.
1584 dataset_types = (dataset_ops.DatasetV1, dataset_ops.DatasetV2)
~/.pyenv/versions/3.8.7/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in distribute_strategy(self)
687 def distribute_strategy(self):
688 """The tf.distribute.Strategy
this model was created under."""
--> 689 return self._distribution_strategy or ds_context.get_strategy()
690
691 @Property
AttributeError: 'Model' object has no attribute '_distribution_strategy'