我正在使用Tensorflow的1.3 Estimator API来执行一些图像分类 . 由于我有大量的数据,我给TFRecords一个机会 . 保存文件并使用估算器模型的input_fn内的解析器函数将示例读取到数据集 . 到现在为止还挺好 .
问题是我想要做一些图像增强(在这种情况下旋转和剪切) .
1)我尝试使用 tf.contrib.keras.preprocessing.image.random_shear
等 . 原来Keras没有't like the format of TF'的形状('Dimension')并且我无法将其转换为列表,因为它的参数是轴索引而不是实际值 .
2)然后我尝试在我选择的范围内使用 tf.contrib.image.rotate
和 tf.contrib.image.transform
随机值 . 这次我收到 NotFoundError: Op type not registered 'ImageProjectiveTransform' in binary running on MYPC. Make sure the Op and Kernel are registered in the binary running in this process.
的错误,这是一个未解决的问题(https://github.com/tensorflow/tensorflow/issues/9672) . 目前我无法从Windows迁移,因此我对可能的替代方案非常感兴趣 .
3)搜索了一种读取TFRecords并将其转换为numpy数组并使用其他工具进行扩充的方法,但是无法从input_fn中找到一种无法访问会话的方法 .
谢谢!
1 回答
您是否尝试过使用以下问题的答案中的功能? tensorflow: how to rotate an image for data augmentation?