I have a issue with converting tfrecords back to images:
def _parse_test_image_function(img):
image_feature_description = {
'image/file_name': tf.io.FixedLenFeature([], tf.string),
'image/encoded_image': tf.io.FixedLenFeature([], tf.string),
}
return tf.io.parse_single_example(img, image_feature_description)
test_dataset = tf.data.TFRecordDataset(temp_path)
test_dataset = test_dataset.map(_parse_test_image_function)
print(tf.__version__)
images = test_dataset.take(1)
print(images)
2.5.0
<TakeDataset shapes: {image/encoded_image: (), image/file_name: ()}, types: {image/encoded_image: tf.string, image/file_name: tf.string}>
Fields in image_feature_description are correct
also I saw this Converting TFRecords back into JPEG Images But this is not very helpful for me because some of functions which is used in answers outdated.