I use the following code to load a bunch of images in my data set in TensorFlow, which works well:
def load(image_file): image = tf.io.read_file(image_