From e228b8f4eb0a771549423d963972dc9e400248fb Mon Sep 17 00:00:00 2001 From: Fuzhan R Date: Thu, 21 Oct 2021 17:59:55 +0200 Subject: [PATCH] The import for conv_utils does not work. (#19) * The import for conv_utils does not work. * Update to import the function from tensorflow.python.keras.utils * * Utilizing conv_util import --- luna/pretrained_models/googlenet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luna/pretrained_models/googlenet.py b/luna/pretrained_models/googlenet.py index 6a85234..f7bd6aa 100644 --- a/luna/pretrained_models/googlenet.py +++ b/luna/pretrained_models/googlenet.py @@ -11,8 +11,8 @@ from tensorflow.keras.layers import Layer, Input, Dense, Conv2D, MaxPooling2D from tensorflow.keras.layers import AveragePooling2D, ZeroPadding2D, Dropout, Flatten from tensorflow.keras.layers import Concatenate, Activation +from tensorflow.python.keras.utils import conv_utils from tensorflow.python.keras.utils.data_utils import get_file -from tensorflow.python.keras.utils.conv_utils import convert_kernel class PoolHelper(Layer): @@ -445,7 +445,7 @@ def create_googlenet(user_weight_path=None): for layer in googlenet.layers: if layer.__class__.__name__ == 'Conv2D': original_w = tf.compat.v1.keras.backend.get_value(layer.kernel) - converted_w = convert_kernel(original_w) + converted_w = conv_utils(original_w) tf.compat.v1.assign(layer.kernel, converted_w) return googlenet