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

Stuck on "loading language traineddata" #439

Closed
chukwumaijem opened this issue Apr 14, 2020 · 3 comments
Closed

Stuck on "loading language traineddata" #439

chukwumaijem opened this issue Apr 14, 2020 · 3 comments

Comments

@chukwumaijem
Copy link

chukwumaijem commented Apr 14, 2020

Describe the bug
I have a simple html with script tags as follows.

  <script src='https://unpkg.com/tesseract.js@v2.1.0/dist/tesseract.min.js'></script>
  <script>
    window.onload = async () => {
      const worker = Tesseract.createWorker({
        logger: m => console.log(m)
      });

      await worker.load();
      await worker.loadLanguage('eng');
      await worker.initialize('eng');
      const recData = await worker.recognize('https://tesseract.projectnaptha.com/img/eng_bw.png');

      console.log('=====recData===', recData);
      await worker.terminate();
    }
  </script>

When the page loads, i the following logs on the console, and nothing else happens. What am I doing wrong?
Screenshot 2020-04-14 at 07 49 48

Environment

  • OS: MacOS Catalina
  • Browser [e.g. chrome version 80]
@jeromewu
Copy link
Member

Most of the time it is a network issue.

You can try to use the offline version first and see if it works: https://github.com/jeromewu/tesseract.js-offline

@0687a4
Copy link

0687a4 commented Sep 5, 2022

adding cachemethod: 'none' in worker constructor solved this issue for me.
loading data and workers from CDN is really the worst design choice in this wrapper.

@Balearica
Copy link
Collaborator

Closed as duplicate of #414. I will look into why the promise returned by loadLanguage never resolves, and post findings on that issue.

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

4 participants