import input_data MNIST tensorflow not working

前端 未结 15 1529
感情败类
感情败类 2020-12-09 14:44

TensorFlow MNIST example not running with fully_connected_feed.py

I checked this out and realized that input_data was not built-in. So I downloaded the

相关标签:
15条回答
  • 2020-12-09 15:38

    For Tensorflow API above 2.0, to use MNIST dataset following command can be used,

    import tensorflow_datasets as tfds
    data = tfds.load(name = "mnist")
    
    0 讨论(0)
  • 2020-12-09 15:40

    So let's assume that you are in the directory: /somePath/tensorflow/tutorial (and this is your working directory).

    All you need to do is to download the input_data.py and put it this. Let the file name where you invoke:

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

    is main.py and it is also in this directory.

    Whenever this is done, you can just start running main.py which will start downloading the files and will put them in the MNIST_data folder (once they are there the script will not be downloading them next time).

    0 讨论(0)
  • 2020-12-09 15:41

    How can I start the tutorial

    I didn't download the folder you did but I installed tensorflow by pip and then I had similar problem.

    My workaround was to replace

    import tensorflow.examples.tutorials.mnist.input_data

    with

    import tensorflow.examples.tutorials.mnist.input_data as input_data

    0 讨论(0)
提交回复
热议问题