From 348c4e665216b4425d7c350cc34cb8561f12e064 Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Thu, 20 Oct 2022 23:43:28 -0700 Subject: [PATCH] Add a test to test saving and loading the gesture recognizer model. Also update the loss function init method to resolve a bug when loading model. PiperOrigin-RevId: 482702020 --- mediapipe/model_maker/python/core/utils/loss_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediapipe/model_maker/python/core/utils/loss_functions.py b/mediapipe/model_maker/python/core/utils/loss_functions.py index 17c738a1..5b0aa32b 100644 --- a/mediapipe/model_maker/python/core/utils/loss_functions.py +++ b/mediapipe/model_maker/python/core/utils/loss_functions.py @@ -56,7 +56,7 @@ class FocalLoss(tf.keras.losses.Loss): class_weight: A weight to apply to the loss, one for each class. The weight is applied for each input where the ground truth label matches. """ - super(tf.keras.losses.Loss, self).__init__() + super().__init__() # Used for clipping min/max values of probability values in y_pred to avoid # NaNs and Infs in computation. self._epsilon = 1e-7