Large dataset with ILSVRC2012 GPU is waiting

i know that’s there is already a dataset for ILSVRC2012 but i want to start frm scratch.

So i downloaded ILSVRC2012 : 1281167 images in 1000 folder (classes)

Now I built my dataset (BATCH_SIZE =512):

list_name = glob.glob( DIR_BASE + "../train/*/*.JPEG")
dataset =
train_dataset = (dataset
test_dataset = train_dataset.take(1000) 

with map function

def load_image_label(path_file):
    raw =
    image = tf.image.decode_jpeg(raw, channels=3)
    image = tf.cast(image, tf.float32) 
    image = tf.image.resize(image, [HEIGHT, WIDTH])
    image.set_shape((HEIGHT, WIDTH, 3))

    x =  tf.strings.substr(path_file, POS_CLASS,POS_CLASS+9)
    label = tf.one_hot(table_folder.lookup(x), NUM_CLASSES)
    return (image / scaleFactor, label)

Now i train my model :

historique =,steps_per_epoch=(len(list_name)-1000) // BATCH_SIZE -1,
                           initial_epoch = epoch_save,
                           callbacks=[tensorboard_callback, checkpoint_callback])

and GPU is at less than 10%
CPU processor is at 10%
and disk less than 70%
Can I Improve my code get gpu to 100%?

platform windows wsl2 tensorflow 2.15