'tensorflow keras fit not showing any information

When using model.fit(), I only see the text "Epoch 1/10", and after a few seconds, it shows "Finished" with exit code: -1073740791 status: 1.

My labels are a one-dimensional array with integers from 0 to 6, and my images are black and white, so the fourth dimension is only 1 in size.

from PIL import Image
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras import datasets, layers, models
import numpy as np

train_data = np.load("train_data.npy")


train_data = train_data / 255
train_data = tf.expand_dims(train_data, axis=-1)


train_labels = np.load("train_labels.npy")


cnn = models.Sequential([
    layers.Conv2D(filters=32, kernel_size=(3, 3), activation='relu', input_shape=(48, 48, 1)),
    layers.MaxPooling2D((2, 2)),

    layers.Conv2D(filters=64, kernel_size=(3, 3), activation='relu'),
    layers.MaxPooling2D((2, 2)),

    layers.Flatten(),
    layers.Dense(64, activation='relu'),
    layers.Dense(10, activation='softmax')
    ])

cnn.compile(optimizer = 'adam',
    loss = 'sparse_categorical_crossentropy',
    metrics = ['accuracy'])
cnn.fit(x = train_data, y = train_labels, epochs = 10)

output :

2022-05-13 21:07:31.973726: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-05-13 21:07:32.385295: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3991 MB memory:  -> device: 0, name: NVIDIA GeForce GTX 1660 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5
Epoch 1/10


---------- FINISHED ----------
exit code: -1073740791 status: 1


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source