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

Error in easyocr.Reader with urlretrieve(model_url[model_file][0], MODEL_PATH) #191

Closed
z-aliakseyeu opened this issue Jul 29, 2020 · 21 comments

Comments

@z-aliakseyeu
Copy link

Hello!
Thanks for that amazing library first of all!
Could someone please help to resolve the issue i encountered today only (yesterday and before it was working smoothly).

in my code i have let's say:

import easyocr
reader = easyocr.Reader(['id', 'en'])

When i run it - i am getting the following error:

CUDA not available - defaulting to CPU. Note: This module is much faster with a GPU.
MD5 hash mismatch, possible file corruption
Re-downloading the recognition model, please wait
Traceback (most recent call last):
  File "tryout_easyocr.py", line 5, in <module>
    reader = easyocr.Reader(['id', 'en'])
  File "/usr/local/lib/python3.7/site-packages/easyocr/easyocr.py", line 194, in __init__
    urlretrieve(model_url[model_file][0], MODEL_PATH)
  File "/usr/local/Cellar/python/3.7.8/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 288, in urlretrieve
    % (read, size), result)

Regardless what language i choose - i face this error in all the environments:

Diving deeper it tries to download the following file:
https://www.jaided.ai/read_download/latin.pth
which i wasn't able to download with wget, curl or browser as well for the same issue.

Seems https://www.jaided.ai/ resets the connection during download

@Proteusiq
Copy link

Proteusiq commented Jul 29, 2020

I am running into the same issue
[RESOLVED]

It is Download issues that happens due to network overload(multiple people trying to download at the same time)
Solved by directly downloading models and place them to %USERPROFILE%/.EasyOCR/model from

detector weight

latin

See #11

@z-aliakseyeu
Copy link
Author

z-aliakseyeu commented Jul 29, 2020

Thanks @Proteusiq !

Now the only question i have is how to download Indonesian lang model 😅

@rkcosmos
Copy link
Contributor

Indonesian language use latin model. If latin model is downloaded and placed in model directory. You should be able to call
reader = easyocr.Reader(['id', 'en']).

@z-aliakseyeu
Copy link
Author

Thanks @rkcosmos!
Is there some plans/ideas how to solve it without manual download?
Maybe i can contribute to make it work smoother?

@rkcosmos
Copy link
Contributor

I plan to move download part behind Cloudflare and let them handle the traffic.

@imvladikon
Copy link
Contributor

The manual download also doesn't work. I checked it (e.g. wget https://www.jaided.ai/read_download/cyrillic.pth -O /content/models/cyrillic.pth and just using a browser download) after several seconds, downloading is interrupted

@rkcosmos
Copy link
Contributor

cyrillic model

@rkcosmos
Copy link
Contributor

too many people trying to get model, I will move it behind Cloudflare tomorrow, otherwise I'm going to broke because of traffic bill.

@SiYuan-Lee
Copy link

I encounter the same issue, where can I download the simple Chinese model instead of the Latin model.

@rkcosmos
Copy link
Contributor

All links are on README.

@xhimalaya
Copy link

I am running into the same issue
[RESOLVED]

It is Download issues that happens due to network overload(multiple people trying to download at the same time)
Solved by directly downloading models and place them to %USERPROFILE%/.EasyOCR/model from

detector weight

latin

See #11

I am running into the same issue
[RESOLVED]

It is Download issues that happens due to network overload(multiple people trying to download at the same time)
Solved by directly downloading models and place them to %USERPROFILE%/.EasyOCR/model from

detector weight

latin

See #11

can you please tell me where to put those files after downloading???

@alexpm94
Copy link

@xhimalaya Place them in ~/.EasyOCR/model. That directory is created when easyocr is installed.

@Prasang-Biyani
Copy link

While downloading the model, I am facing this issue.
image

@rkcosmos
Copy link
Contributor

sorry, my website is down

@rkcosmos
Copy link
Contributor

it should be up now.

@Prasang-Biyani
Copy link

nope, still not working

@rkcosmos
Copy link
Contributor

not sure what's going on. At least website is up. You can also try manual download links from google drive. The links are on README.

@Vijayabhaskar96
Copy link
Contributor

A Suggestion to @rkcosmos You can host the models on https://gofile.io and add the direct download link as a mirror link to it so that if the model fails to download from your website it can retry to download from Gofile.io for the meantime till you host the models on Cloudflare.

@rkcosmos
Copy link
Contributor

thanks for the suggestion, it's already behind CDN. Good to know the alternative.

@imvladikon
Copy link
Contributor

imvladikon commented Aug 1, 2020

@Vijayabhaskar96 @rkcosmos I think there is a way to do it like in the spacy package and model for spacy. They just provide models through assets on the GitHub and module for downloading it e.g. https://github.com/explosion/spaCy/releases/tag/v2.3.0 and another option is just google drive (retrieving using https://pypi.org/project/gdown/)

@rkcosmos
Copy link
Contributor

rkcosmos commented Aug 2, 2020

@imvladikon @Vijayabhaskar96 At the end, cloudflare doesn't allow heavy download traffic. I end up with downloading from google drive. thanks for ur suggestion.

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

9 participants