Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def load_cfar10_batch(cifar10_dataset_folder_path, batch_id):
- with open(cifar10_dataset_folder_path + '/data_batch_' + str(batch_id), mode='rb') as file:
- # note the encoding type is 'latin1'
- batch = pickle.load(file, encoding='latin1')
- features = batch['data'].reshape((len(batch['data']), 3, 32, 32)).transpose(0, 2, 3, 1)
- labels = batch['labels']
- return features, labels
Add Comment
Please, Sign In to add comment