Skip to content

Instantly share code, notes, and snippets.

@MaoXianXin
MaoXianXin / mnist_tfdata.py
Last active May 27, 2019 14:07 — forked from datlife/mnist_tfdata.py
Training Keras model with tf.data
"""An example of how to use tf.Dataset in Keras Model"""
import tensorflow as tf # only work from tensorflow==1.9.0-rc1 and after
import os
import numpy as np
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
_EPOCHS = 50
_NUM_CLASSES = 10
_BATCH_SIZE = 128
def training_pipeline():
# #############