I am trying to use Tensorflow for the first time
Here is my code that I got from a tutorial:
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
learn = tf.contrib.learn
tf.logging.set_verbosity(tf.logging.ERROR)
mnist = learn.datasets.load_dataset('mnist')
data = mnist.train.image //THIS IS WHERE THE ERROR OCCURS
labels = np.asarray(mnist.train.labels, dtype=np.int32)
test_data = mnist.test.images
test_labels = np.asarray(mnist.test.labels, dtype = np.int32)
I get this error at the line specified above AttributeError: 'DataSet' object has no attribute 'image'
How do I fix this?
The MNIST DataSet
object (implemented here) does not have an image
property, but it does have an images
property. The following change should fix things:
data = mnist.train.images
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With