I posted this question on stackoverflow and got downvoted for unmentioned reason, so I'll repost it here, hoping to get some insights
This is the code:
with strategy.scope():
model2 = tf.keras.applications.VGG16(
include_top=True,
weights=None,
input_tensor=None,
input_shape=(32, 32, 3),
pooling=None,
classes=10,
classifier_activation="relu",
)
model2.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
history = model2.fit(
train_images, train_labels,epochs=10,
validation_data=(test_images, test_labels)
)
I'm trying to train VGG16 from scratch, hence not importing their weights I also tried a model which I created myself, with same hyperparameters, and that worked fine
Any help is highly appreciated
Heres the full code