faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.38k stars 355 forks source link

AssertionError on sha256 of #122

Closed cmdlinebeep closed 3 years ago

cmdlinebeep commented 3 years ago

Thanks for putting this library together.

I'm trying to run the example notebook keras_ocr_coco_benchmark_public.ipynb on Google Colab and getting the following error:

Looking for /root/.keras-ocr/craft_mlt_25k.h5
Downloading /root/.keras-ocr/craft_mlt_25k.h5
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-11-16a4a824dc22> in <module>()
      1 step_size = 100
----> 2 pipeline = keras_ocr.pipeline.Pipeline(scale=2)
      3 for scale in [3]:
      4     pipeline.scale = scale
      5     keras_ocr_annotations = {}

2 frames
/usr/local/lib/python3.6/dist-packages/keras_ocr/tools.py in download_and_verify(url, sha256, cache_dir, verbose, filename)
    452             print('Downloading ' + filepath)
    453         urllib.request.urlretrieve(url, filepath)
--> 454     assert sha256 is None or sha256 == sha256sum(filepath), 'Error occurred verifying sha256.'
    455     return filepath
    456 

AssertionError: Error occurred verifying sha256.

It appears to be trying to download the model weights/biases file and dying on that.

The setup steps of installing all the packages worked fine and I am able to import the libraries with no issue. What am I doing wrong?

faustomorales commented 3 years ago

Hi there! This is because I've hit my bandwidth limit for sharing files via MediaFire using direct download. You can download the files manually and place them in ~/.keras-ocr (in your case, ~ is /root). Please see https://github.com/faustomorales/keras-ocr/issues/117 for more information on this. My apologies for the inconvenience -- there really is no such thing as a free lunch or free cloud storage. 🙃

cmdlinebeep commented 3 years ago

Thank you, working for me now in Colab.