hns
hns

Reputation: 9

How to unpickle CIFAR-10, load batches and split datasets?

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

Upvotes: 0

Views: 2423

Answers (1)

nickyfot
nickyfot

Reputation: 2019

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.

Upvotes: 0

Related Questions