本文介绍了如何在 TensorFlow v1.9 中下载 MNIST?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 TensorFlow 教程.我已经在 python 3.6 中安装了 Tensorflow r1.9

I am following a TensorFlow Tutorial.I have installed Tensorflow r1.9 in python 3.6

我有空闲的导入:

from tensorflow.examples.tutorials.mnist import input_data

我以休闲方式使用它:

mnist = input_data.read_data_sets("mnist_data/", one_hot=True)

我收到警告/错误:

read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating: Please use alternatives such as official/mnist/dataset.py from tensorflow/models.

python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:260: maybe_download (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version. 

Instructions for updating:
Please write your own downloading logic.

在 r1.9 中使用 mnist 的正确方法是什么?

what is the correct way to work with mnist in r1.9?

推荐答案

现在最好的方法是在 tensorflow 中使用 keras 模块:

Best way now is using the keras module in tensorflow:

from tensorflow import keras

mnist = tf.keras.datasets.mnist
(train_images, train_labels),(test_images, test_labels) = mnist.load_data()

这篇关于如何在 TensorFlow v1.9 中下载 MNIST?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 02:15