Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pickle fails with EOFError while loading models on Windows #12

Closed
dniku opened this issue Dec 21, 2014 · 4 comments
Closed

Pickle fails with EOFError while loading models on Windows #12

dniku opened this issue Dec 21, 2014 · 4 comments

Comments

@dniku
Copy link

dniku commented Dec 21, 2014

Here's the traceback (I edited the path to \ocropy):

D:\ocropy>python ocropus-rpred -Q 2 -m D:\ocropy\models\fraktur.pyrnn.gz  T:\0001.bin.png

########## ocropus-rpred -Q 2 -m D:\ocropy\models\fr

#inputs 1
# loading object D:\ocropy\models\fraktur.pyrnn.gz
Traceback (most recent call last):
  File "ocropus-rpred", line 103, in <module>
    network = ocrolib.load_object(args.model,verbose=1)
  File "D:\ocropy\ocrolib\common.py", line 513, in load_object
    return unpickler.load()
EOFError

0001.bin.png is:

0001 bin

fraktur.pyrnn.gz is freshly downloaded from http://www.tmbdev.net/fraktur.pyrnn.gz. I am running Win7 x64 and Python 2.7.6 x64.

Also, why do the instructions first suggest downloading en-default.pyrnn.gz and then running with fraktur.pyrnn.gz?

@tmbdev
Copy link
Collaborator

tmbdev commented Jan 14, 2015

Did you download the model in binary mode?

That particular page and example is in Fraktur (traditional German script), not English, so you need a different model.

@tmbdev tmbdev closed this as completed Apr 24, 2015
@CruzzRazor
Copy link

CruzzRazor commented Nov 30, 2017

I am getting the same problem while loading the model in windows. what should i do?
the error message is as follows

$ ./run-test
INFO:  # ./tests/testpage.png
INFO:  === ./tests/testpage.png 1
INFO:  estimating skew angle
INFO:  estimating thresholds
INFO:  rescaling
INFO:  ./tests/testpage.png lo-hi (0.39 1.44) angle  0.1 no-normalization
INFO:  writing
INFO:
INFO:  ########## C:/Users/allud/ocropy/env/Scripts/ocropus-gpageseg temp/????
INFO:
INFO:  temp\0001.bin.png
INFO:  scale 19.493589
INFO:  computing segmentation
INFO:  computing column separators
INFO:  considering at most 3 whitespace column separators
INFO:  computing lines
INFO:  propagating labels
INFO:  spreading labels
INFO:  number of lines 100
INFO:  finding reading order
INFO:  writing lines
INFO:      91  temp\0001.bin.png 19.5 92
INFO:
INFO:  ########## C:/Users/allud/ocropy/env/Scripts/ocropus-rpred -n temp/????
INFO:
INFO:  #inputs: 92
# loading object .\models\en-default.pyrnn.gz
Traceback (most recent call last):
  File "C:/Users/allud/ocropy/env/Scripts/ocropus-rpred", line 120, in <module>
    network = ocrolib.load_object(args.model,verbose=1)
  File "c:\python27\Lib\ocrolib\common.py", line 445, in load_object
    return unpickler.load()
EOFError
(env)

@amitdo
Copy link
Contributor

amitdo commented Nov 30, 2017

@csteelatgburg
Copy link

In version 1.3.3 I found the common.py is opening the model using gunzip, which is not available on Windows natively. Adding an import gzip, uncommenting line 442 and commenting out 443 resolved the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants