简体   繁体   中英

tf.data vs tf.keras.preprocessing.image.ImageDataGenerator

I was reading about different techniques to load large data efficiently. The tf.data seems to perform well as compared to tf.keras.preprocessing.imageImageDataGenerator.

To what I know is, tf.data uses CPU pipelining to efficiently load the data and process it so that model training is continuous and fast. But I did not understand how these two techniques are different and in what way. If anybody can explain this I would highly appreciate it.

the main difference is that ImageDataGenerator uses Pillow library for loading and preprocessing image and tf.data uses tf.image pre-processing technique. ImageDataGenerator returns a batches of tensor Images.Also tf.data uses functions like prefetch , cache to improve the efficiency of preparing the dataset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM