Failed to interpret file './cifar-10-batches-py/data_batch_1' as a pickle
Created by: axsaucedo
Minor issue in Image Classification Tutorial
When running the "process_cifar.py" file /demos/image_classification/data on Python 3.4, I get the error:
OSError: Failed to interpret file './cifar-10-batches-py/data_batch_1' as a pickle
This error appears when np.load tries to open the data_batch_1 file.
I was able to walk around this issue by using cPickle directly as follows:
def get_data(batch_path):
f = open(batch_path, 'rb')
d = cPickle.load(f, encoding='bytes')
d_decoded = {}
for k, v in d.items():
d_decoded[k.decode('utf8')] = v
d = d_decoded
f.close()
data = d['data']
labels = d['labels']
filenames = [b.decode("utf-8") for b in d['filenames']]
return data, labels, filenames
I'm not sure if this is due to a python versioning problem, but more users might experience this issue.
Thank you.