IPythonTheanoTutorials icon indicating copy to clipboard operation
IPythonTheanoTutorials copied to clipboard

Error: 'OfficialImageClassification' object has no attribute 'train'

Open apitts opened this issue 12 years ago • 1 comments

In the Intro to Scikit Data (skdata) notebook, I receive the following error message when running the below code: from skdata.mnist.views import OfficialImageClassification task = OfficialImageClassification() print 'Digit shape', task.train.x[0].shape imshow(task.train.x[0][:,:,0], cmap=cm.gray, interpolation='nearest')


AttributeError Traceback (most recent call last) in () 1 from skdata.mnist.views import OfficialImageClassification 2 task = OfficialImageClassification() ----> 3 print 'Digit shape', task.train.x[0].shape 4 imshow(task.train.x[0][:,:,0], cmap=cm.gray, interpolation='nearest')

AttributeError: 'OfficialImageClassification' object has no attribute 'train'

The other two datasets work fine.

apitts avatar Jul 31 '13 01:07 apitts

The code could be changed like so:

      from skdata.mnist.views import OfficialImageClassification
      task = OfficialImageClassification()
      # print 'Digit shape', task.train.x[0].shape
      # imshow(task.train.x[0][:,:,0], cmap=cm.gray, interpolation='nearest')
      print 'Digit shape', task.all_images[0].shape
      imshow(task.all_images[0].reshape((28, -1)), cmap=cm.gray, interpolation='nearest')

davegreenwood avatar Nov 17 '14 13:11 davegreenwood