{ "cells": [ { "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "gQskE9NgL-ZB" }, "source": [ "Copyright 2018 The TensorFlow Datasets Authors, Licensed under the Apache License, Version 2.0" ] }, { "cell_type": "code", "execution_count": 0, "metadata": { "colab": {}, "colab_type": "code", "id": "RPo1Cw2p83pb" }, "outputs": [], "source": [ "!pip install -q tensorflow-datasets tensorflow" ] }, { "cell_type": "code", "execution_count": 0, "metadata": { "colab": {}, "colab_type": "code", "id": "S-RWB9G48uJA" }, "outputs": [], "source": [ "from __future__ import absolute_import\n", "from __future__ import division\n", "from __future__ import print_function\n", "\n", "import tensorflow as tf\n", "import tensorflow_datasets as tfds\n", "\n", "# tfds works in both Eager and Graph modes\n", "tf.enable_eager_execution()\n", "\n", "# See available datasets\n", "print(tfds.list_builders())\n", "\n", "# Construct a tf.data.Dataset\n", "dataset = tfds.load(name=\"mnist\", split=tfds.Split.TRAIN)\n", "\n", "# Build your input pipeline\n", "dataset = dataset.shuffle(1024).batch(32).prefetch(tf.data.experimental.AUTOTUNE)\n", "for features in dataset.take(1):\n", " image, label = features[\"image\"], features[\"label\"]" ] } ], "metadata": { "colab": { "collapsed_sections": [], "name": "tensorflow/datasets", "provenance": [], "version": "0.3.2" } }, "nbformat": 4, "nbformat_minor": 0 }