ilovin / lstm_ctc_ocr

Use CTC + tensorflow to OCR
https://ilovin.github.io/2017-04-06/tensorflow-lstm-ctc-ocr/
354 stars 140 forks source link

OSError: cannot open resource #19

Closed MyraBaba closed 6 years ago

MyraBaba commented 7 years ago

any idea ?

multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "/Users/alpullu/Downloads/lstm_ctc_ocr-dev/lib/utils/genImg.py", line 26, in generateImg data=captcha.generate(theChars) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/captcha/image.py", line 45, in generate im = self.generate_image(chars) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/captcha/image.py", line 226, in generate_image im = self.create_captcha_image(chars, color, background) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/captcha/image.py", line 197, in create_captcha_image images.append(_draw_character(c)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/captcha/image.py", line 164, in _draw_character font = random.choice(self.truefonts) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/captcha/image.py", line 122, in truefonts for n in self._fonts File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/captcha/image.py", line 123, in for s in self._font_sizes File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/ImageFont.py", line 238, in truetype return FreeTypeFont(font, size, index, encoding) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/ImageFont.py", line 127, in init self.font = core.getfont(font, size, index, encoding) OSError: cannot open resource """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1596, in globals = debugger.run(setup['file'], None, None, is_module) File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 974, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/Users/alpullu/Downloads/lstm_ctc_ocr-dev/lib/utils/genImg.py", line 41, in run(64*2000,'./data/train') File "/Users/alpullu/Downloads/lstm_ctc_ocr-dev/lib/utils/genImg.py", line 38, in run pool.map(generateImg,range(num)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 260, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 608, in get raise self._value OSError: cannot open resource

Process finished with exit code 1

ilovin commented 7 years ago

in which directory did you execute the script

MyraBaba commented 7 years ago

I moved to beta now. But I recognize that warpctc could not be support the OSx ? so should I stop strugling or move ?

I ran the code in the dev path.

ilovin commented 7 years ago

why not try ubuntu

MyraBaba commented 7 years ago

in ubuntu it gaves belao error:

lib/python2.7/lib-dynload/operator.so: undefined symbol: _PyUnicodeUCS4_AsDefaultEncodedString

ilovin commented 7 years ago

https://github.com/conda/conda/issues/296

ilovin commented 6 years ago

if you have any further questions, feel welcome to reopen