How to unpack pkl file?
问题 I have a pkl file from MNIST dataset, which consists of handwritten digit images. I'd like to take a look at each of those digit images, so I need to unpack the pkl file, except I can't find out how. Is there a way to unpack/unzip pkl file? 回答1: Generally Your pkl file is, in fact, a serialized pickle file, which means it has been dumped using Python's pickle module. To un-pickle the data you can: import pickle with open('serialized.pkl', 'rb') as f: data = pickle.load(f) For the MNIST data