EOFError using cPickle.load() on windows
NickName:Jarvin Li Ask DateTime:2016-12-01T09:31:41

EOFError using cPickle.load() on windows

Hi guys so I'm having a bit of a problem, I'm trying to load a file using pickle(code below), this code runs perfectly on my partner's laptop(mac book), but on my laptop it won't run(Windows).

strPath = openFileDialog.GetPath()
self.model = cPickle.load(open(strPath, 'rb'))
self.loadModelCombo.SetValue(strPath)

After using that code to load the file, I get an EOFError.

>File "CMain.py", line 511, in loadModel
>self.model = cPickle.load(open(strPath, 'rb'))
>EOFError

Copyright Notice:Content Author:「Jarvin Li」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40901185/eoferror-using-cpickle-load-on-windows

More about “EOFError using cPickle.load() on windows” related questions

EOFError using cPickle.load() on windows

Hi guys so I'm having a bit of a problem, I'm trying to load a file using pickle(code below), this code runs perfectly on my partner's laptop(mac book), but on my laptop it won't run(Windows). str...

Show Detail

python 2.6 cPickle.load results in EOFError

I use cPickle to pickle a list of integers, using HIGHEST_PROTOCOL, cPickle.dump(l, f, HIGHEST_PROTOCOL) When I try to unpickle this using the following code, I get an EOFError. I tried 'seeking'...

Show Detail

EOFError when trying to load large dictionary using cPickle

I'm trying to load two large dictionaries that I pickled earlier using cPickle. Here's the code that I used to create the pickle: f_out = open("file_1.pickle", 'wb') cPickle.dump(obj_1, f_out, pro...

Show Detail

Python: EOFError using cPickle while running a class instance

This is the code snippet causing the problem: if str(sys.argv[2]) + '.pickle' in os.listdir(os.curdir): #os.path.isfile(str(sys.argv[2]) + '.pickle'): path = sys.argv[2] + '.pickle'

Show Detail

cPickle exceptions.EOFError in python

I tried to run this code in python but it gives me an exceptions.EOFError. Can you tell me why? Thanks to any replies f = gzip.open('../data/mnist.pkl.gz', 'rb') training_data, validation_data,

Show Detail

Why do I get EOFError error when trying to read MNIST data?

import cPickle, gzip, numpy data = cPickle.load(gzip.open('mnist.pkl.gz', 'rb')) trndata=data['train'] tstdata=data['test'] I was getting this error when I was running this code :

Show Detail

python unpickling EOFError when Reading file

I've written a basic storage class that holds data in a list of lists writes it to a file and then allows it to be read back from the file for persistence. It was working on the system it was origi...

Show Detail

pickle.load() raising EOFError in Windows

This is how the code is with open(pickle_f, 'r') as fhand: obj = pickle.load(fhand) This works fine on Linux systems but not on Windows. Its showing EOFError. I have to use rb mode to make i...

Show Detail

pickle.load() raising EOFError in Windows

This is how the code is with open(pickle_f, 'r') as fhand: obj = pickle.load(fhand) This works fine on Linux systems but not on Windows. Its showing EOFError. I have to use rb mode to make i...

Show Detail

EOFError when using Python "cPickle.load" to load a C++-written binary file

I wrote a binary file using C++ fwrite and try to using cPickle.load to load this file. However I got errors data = pickle.load(f) EOFError My C++ write file code is FILE* bp = fopen("res.bin...

Show Detail