from __future__ import absolute_import, division, print_function, unicode_literals
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
# print(tfds.list_builders())
mnist_train, info = tfds.load(name="mnist", split="train", with_info=True,data_dir=".//datasets")
assert isinstance(mnist_train, tf.data.Dataset)
print(mnist_train)
# for mnist_example in mnist_train.take(1):
# image, label = mnist_example["image"], mnist_example["label"]
# plt.imshow(image.numpy()[:, :, 0].astype(np.float32), cmap = plt.get_cmap('gray'))
# print("Label: %d" % label.numpy())
# plt.pause(0)
print(info)
fig = tfds.show_examples(info, mnist_train)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。