Method to load image data for TPU

300 views Asked by At

So currently both keras.ImageDataGenerator and tf.data.Dataset are not working with tensorflow TPU, Is there any Other method to load image data for training model on Tpu ?

1

There are 1 answers

2
Andrey On BEST ANSWER

You can use GCS buckets.

Or you read from files:

with open(image_path, "rb") as local_file:
  img = local_file.read()

And then convert to tensor and create dataset with tf.data.Dataset.from_tensor_slices.