From 5de977383accf74fd410e8f313d9e85ed605aef1 Mon Sep 17 00:00:00 2001 From: Jagar <41321155+JagarYousef@users.noreply.github.com> Date: Wed, 27 Mar 2024 20:02:14 +0300 Subject: [PATCH 1/3] Update models.py --- keras_vggface/models.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keras_vggface/models.py b/keras_vggface/models.py index 28e11c0..5376be2 100644 --- a/keras_vggface/models.py +++ b/keras_vggface/models.py @@ -9,18 +9,18 @@ ''' -from keras.layers import Flatten, Dense, Input, GlobalAveragePooling2D, \ +from tensorflow.python.keras.layers import Flatten, Dense, Input, GlobalAveragePooling2D, \ GlobalMaxPooling2D, Activation, Conv2D, MaxPooling2D, BatchNormalization, \ AveragePooling2D, Reshape, Permute, multiply from keras_applications.imagenet_utils import _obtain_input_shape -from keras.utils import layer_utils -from keras.utils.data_utils import get_file -from keras import backend as K +from tensorflow.python.keras.utils.data_utils import get_file +from tensorflow.python.keras import backend as K from keras_vggface import utils -from keras.utils.layer_utils import get_source_inputs +from tensorflow.python.keras.utils.layer_utils import get_source_inputs import warnings -from keras.models import Model -from keras import layers +from tensorflow.python.keras.models import Model +from tensorflow.python.keras import layers + def VGG16(include_top=True, weights='vggface', From 7d81420c4e52805484656f88dd7c4cd0cce34600 Mon Sep 17 00:00:00 2001 From: Jagar <41321155+JagarYousef@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:22:04 +0300 Subject: [PATCH 2/3] Update models.py --- keras_vggface/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keras_vggface/models.py b/keras_vggface/models.py index 5376be2..35ed1ae 100644 --- a/keras_vggface/models.py +++ b/keras_vggface/models.py @@ -8,9 +8,9 @@ ''' - +from keras.layers import BatchNormalization from tensorflow.python.keras.layers import Flatten, Dense, Input, GlobalAveragePooling2D, \ - GlobalMaxPooling2D, Activation, Conv2D, MaxPooling2D, BatchNormalization, \ + GlobalMaxPooling2D, Activation, Conv2D, MaxPooling2D, \ AveragePooling2D, Reshape, Permute, multiply from keras_applications.imagenet_utils import _obtain_input_shape from tensorflow.python.keras.utils.data_utils import get_file From 9b61c91ebed6ca259281c64517c0a84145b1ec88 Mon Sep 17 00:00:00 2001 From: Jagar <41321155+JagarYousef@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:39:20 +0300 Subject: [PATCH 3/3] Update utils.py --- keras_vggface/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras_vggface/utils.py b/keras_vggface/utils.py index dd0d9d0..ab90545 100644 --- a/keras_vggface/utils.py +++ b/keras_vggface/utils.py @@ -9,7 +9,7 @@ import numpy as np from keras import backend as K -from keras.utils.data_utils import get_file +from tensorflow.python.keras.utils.data_utils import get_file V1_LABELS_PATH = 'https://github.com/rcmalli/keras-vggface/releases/download/v2.0/rcmalli_vggface_labels_v1.npy' V2_LABELS_PATH = 'https://github.com/rcmalli/keras-vggface/releases/download/v2.0/rcmalli_vggface_labels_v2.npy'