

To ensure you have a version of TensorFlow that is compatible with TensorFlow-IO, People who are a little more adventurous can also try our nightly binaries: $ pip install tensorflow-io-nightly The tensorflow-io Python package can be installed with pip directly using: $ pip install tensorflow-io

Please check the official documentation for moreĭetailed and interesting usages of the package. We can pass the URL's for the compressed files (gzip) to the API call as is. NOTE: Since tensorflow-io is able to detect and uncompress the MNIST dataset automatically if needed, Thus eliminating the need for downloading and saving datasets on a local directory. This is due to the inherent support that tensorflow-io provides for HTTP/ HTTPS file system, To access the dataset files are passed directly to the _mnist API call. fit ( d_train, epochs = 5, steps_per_epoch = 200 ) compile ( optimizer = "adam", loss = "sparse_categorical_crossentropy", metrics = ) # Fit the model. float32 ), y )) # prepare batches the data just like any other tf.data.Dataset d_train = d_train. shuffle ( buffer_size = 1024 ) # By default image data is uint8, so convert to float32 using map(). from_mnist ( dataset_url + "train-images-idx3-ubyte.gz", dataset_url + "train-labels-idx1-ubyte.gz", ) # Shuffle the elements of the dataset. The data processing aspect replaced by tensorflow-io: import tensorflow as tf import tensorflow_io as tfio # Read the MNIST data into the IODataset. The use of tensorflow-io is straightforward with keras. A full list of supported file systemsĪnd file formats by TensorFlow I/O can be found here. TensorFlow I/O is a collection of file systems and file formats that are notĪvailable in TensorFlow's built-in support.
