matex icon indicating copy to clipboard operation
matex copied to clipboard

AttributeError:Datasets' object has no attribute 'training_data

Open Harold-Zhang opened this issue 7 years ago • 1 comments

I tested the code from /matex/src/deeplearning/tensorflow/examples/glibc_after_2.19/MNIST/tf_lenet3.py with command python tf_lenet3.py and I got an error:

Traceback (most recent call last):
  File "tf_lenet3.py", line 17, in <module>
    mnist = tf.DataSet("MNIST", normalize=255.0)
AttributeError: module 'tensorflow' has no attribute 'DataSet'

Then, I modified the code. I added from tensorflow.examples.tutorials.mnist import input_data and mnist = input_data.read_data_sets('MNIST_data', one_hot=True), removed mnist = tf.DataSet("MNIST", normalize=255.0) and I got the following error:

Traceback (most recent call last):
  File "tf_lenet3.py", line 70, in <module>
    for train_batch in range(int(len(mnist.training_data)/args.train_batch)):
AttributeError: 'Datasets' object has no attribute 'training_data'

What should I do to solve the problem? @jeffdaily @vamatya @abhinavvishnu @charlesmsiegel @cabe1980 Thanks for your help!

Harold-Zhang avatar Dec 15 '17 09:12 Harold-Zhang

Our DataSet class and the Tensorflow Datasets class do not have compatible interfaces. Which version of the code are you using? Could you post the contents of your /mates/src/deeplearning/tensorflow/gpu/py3.x/py_distro/lib/python3.5/site-packages/tensorflow/init.py (or appropriate analogue if using cpu version)?

charlesmsiegel avatar Dec 29 '17 17:12 charlesmsiegel