You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
Error when Finetuning: WARNING:absl:Importing a function (__inference___call___15879) with ops with custom gradients. Will likely fail if a gradient is requested.
#190
Open
aynesss opened this issue
Feb 8, 2022
· 2 comments
I work with TF version 2.4.1,
Here is how I finetune the saved checkpoint of ResNet :
###Model ##############################
def create_model():
baseModel = tf.keras.models.load_model("gs://simclr-checkpoints-tf2/simclrv1/pretrain/1x/saved_model/")
headModel = baseModel.output
layer1 = tf.keras.layers.GlobalAveragePooling2D()(headModel)
layer1 = tf.keras.layers.Flatten(name="flatten")(layer1)
layer1 = tf.keras.layers.Dense(128, activation="relu", name="aa")(layer1)
layer1 = tf.keras.layers.Dropout(0.5)(layer1)
model_output = tf.keras.layers.Dense(3, activation="softmax", name="output")(layer1)
# compile the model
model = tf.keras.Model(inputs=baseModel.input, outputs=model_output)
for layer in model.layers:
layer.trainable = True
model.compile(optimizer=tf.keras.optimizers.SGD(learning_rate=0.001),
loss=tf.keras.losses.CategoricalCrossentropy(),
metrics=[tf.keras.metrics.CategoricalAccuracy()])
return model
But I found this error: WARNING:absl:Importing a function (__inference___call___15879) with ops with custom gradients. Will likely fail if a gradient is requested.
The text was updated successfully, but these errors were encountered:
I work with TF version 2.4.1,
Here is how I finetune the saved checkpoint of ResNet :
But I found this error:
WARNING:absl:Importing a function (__inference___call___15879) with ops with custom gradients. Will likely fail if a gradient is requested.
The text was updated successfully, but these errors were encountered: