0

Working on CIFAR-10 Dataset Classification using Convolutional Neural Networks. I am unable to understand:

1) where to extract CIFAR-10 dataset files 2) how to load the batches using pickle framework 3) split dataset into training data and test data

Please help with the code, Using python 3.6 on jupyter notebook.

I tried this, but nothing seems to work. May be because i saved the CIFAR-10 file at wrong location.

def unpickle(file):
    import pickle
    with open(file, 'rb') as fo:
        dict = pickle.load(fo, encoding='bytes')
    return dict
desertnaut
  • 57,590
  • 26
  • 140
  • 166
hns
  • 9
  • 6
  • What *exactly* is your issue? "Nothing seems to work" is hardly informative – desertnaut Apr 02 '19 at 09:58
  • The above code is not loading CIFAR-10 datasets. I am confused where to extract the files for the upload using pickle and what 'file' in the code line "def unpickle(file)" means? – hns Apr 03 '19 at 21:09

1 Answers1

0

You can try to load the data using keras datasets:

from keras.datasets import cifar10

(x_train, y_train), (x_test, y_test) = cifar10.load_data()

Documentation is here . It should help with all 3 questions you have, as keras handles everything for you.

nickyfot
  • 1,932
  • 17
  • 25
  • I actually have to use pickle only to load the data set. The code from this link for python 3 is not working for me: https://www.cs.toronto.edu/~kriz/cifar.html I think because i don`t know where to save the CIFAR-10 files before i upload it. – hns Apr 03 '19 at 20:56