Skip to content

Instantly share code, notes, and snippets.

@ChunML
Last active December 12, 2018 04:51
Show Gist options
  • Save ChunML/28e442d07b06a13092f7f39cbd396881 to your computer and use it in GitHub Desktop.
Save ChunML/28e442d07b06a13092f7f39cbd396881 to your computer and use it in GitHub Desktop.
def one_shot_input_fn(filenames, labels):
dataset = tf.data.Dataset.from_tensor_slices((filenames, labels))
dataset = dataset.map(_parse_data).batch(1)
iterator = dataset.make_one_shot_iterator()
img, label = iterator.get_next()
return img, label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment