Last active
April 17, 2023 17:18
-
-
Save doleron/267415e9000a9471fd89779afbf68e16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VALIDATION_BATCH_SIZE = 2 | |
def build_validation_dataset(): | |
pairs_tensor = tf.convert_to_tensor(validation_pairs) | |
labels_tensor = tf.convert_to_tensor(validation_pairs_labels) | |
result = tf.data.Dataset.from_tensor_slices((pairs_tensor, labels_tensor)) | |
result = result.map(lambda pair, label: (load_images(pair), label)) | |
result = result.batch(VALIDATION_BATCH_SIZE) | |
result = result.prefetch(tf.data.AUTOTUNE) | |
return result | |
validation_ds = build_validation_dataset() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment