Guest User

Untitled

a guest
Apr 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. def load_cfar10_batch(cifar10_dataset_folder_path, batch_id):
  2. with open(cifar10_dataset_folder_path + '/data_batch_' + str(batch_id), mode='rb') as file:
  3. # note the encoding type is 'latin1'
  4. batch = pickle.load(file, encoding='latin1')
  5.  
  6. features = batch['data'].reshape((len(batch['data']), 3, 32, 32)).transpose(0, 2, 3, 1)
  7. labels = batch['labels']
  8.  
  9. return features, labels
Add Comment
Please, Sign In to add comment