سلام وقت بخیر
در زمان compile کردن فرمودید بهتر است از فرمان Sparse استفاده کنیم.
model.compile(loss='sparse_categorical_crossentropy', optimizer='adam',metrics=['categorical_accuracy'])
زمانیکه من از این فرمان استفاده کردم در زمان fit کردن در همان epochs اول با error زیر مواجه شدم. دلیل چیست؟ (با عوض کردن مدل compile و حذف Sparse موضوع حل شد.)
Shape mismatch: The shape of labels (received (3000,)) should equal the shape of logits except for the last dimension (received (300, 10)).