tensorflow - 我应该使用哪一个来预处理图像?
问题描述
我应该使用哪一个来预处理图像。使用 keras 的 ImageDataGenerator 还是使用 tensorflow 的 tf.data?哪个性能更好?
解决方案
根据我的经验,应该使用 tf.data,因为在使用map
数据集进行预处理时,通过调整并行调用的数量来优化有很大的空间。
例如: https ://www.tensorflow.org/guide/data#decoding_image_data_and_resizing_it
并行化数据转换:https ://www.tensorflow.org/guide/data_performance#parallelizing_data_transformation
推荐阅读
- python - 基于映射数组值从python DataFrame中获取值
- firebase - firebase 无密码身份验证如何与颤振应用程序的动态链接一起使用?
- python - Django REST Upload CSV 返回所有帖子的响应
- javascript - 正则表达式创建允许,禁止少数字符
- javascript - WebGL 中的旋转三角形
- java - 为模型创建许多 DTO 是一种好习惯吗?
- firebase - Firestore 集合具有时间戳字段时的索引查询
- d3.js - 将字符串时间戳转换为小时轴
- linux - java.lang.OutOfMemoryError:无法创建新的本机线程线程:总共 6347
- awk - awk 将输出从行对齐到列