Munjal,
I my case the problem was the wrong traineddata files. The problem caused 
by incorrect way of downloading it from GitHub. 
The correct way is to click on file and enter the  page (e.g. 
https://github.com/tesseract-ocr/tessdata_best/blob/master/eng.traineddata).
Inside the page right click on "Download" button and "Copy link address", 
so you"ll have the link in the clipboard 
(e.g. 
https://github.com/tesseract-ocr/tessdata_best/raw/master/eng.traineddata).
Then just wget the copied link.
In the end ensure that downloaded files are of the same size as in github, 
so you"ll be sure files are ok.


On Thursday, December 28, 2017 at 1:42:38 PM UTC+2, Munjal Dhamecha wrote:
>
> Hi Sasha,
>
> I am facing same problem but unable to find solution.
>
> Would you please help share exact steps you followed that resolved the 
> issue?
>
>
>
> On Monday, 25 December 2017 17:33:08 UTC+5:30, Sasha Ostrikov wrote:
>>
>> Wow!!! Shree you are the KING!!!! As you told - files were corrupted...I 
>> used wget all the time but the links I used were copied incorrectly from 
>> github. 
>> Now I clicked on files and copied link from Download button and that 
>> worked like a charm!!!!
>> Thank you so much my friend!!!! :)
>>
>> On Monday, December 25, 2017 at 1:16:38 PM UTC+2, shree wrote:
>>>
>>> Looks like the traineddata files are corrupted or did not download ok 
>>> and hence you are getting file not found issues.
>>>
>>> Check the file sizes - you may want to download using wget or curl.
>>>
>>> root@All-in-1-Touch:/mnt/c/Users/User/shree/tessdata_best# ll 
>>> *.traineddata
>>> -rwxrwxrwx 1 root root  13077423 Sep 25 13:56 chi_sim.traineddata*
>>> -rwxrwxrwx 1 root root  15400601 Sep 15 08:53 eng.traineddata*
>>> -rwxrwxrwx 1 root root 101402885 Sep 16 18:26 Latin.traineddata*
>>> -rwxrwxrwx 1 root root   7418529 Sep 15 09:05 osd.traineddata*
>>>
>>>
>>> ShreeDevi
>>> ____________________________________________________________
>>> भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com
>>>
>>> On Mon, Dec 25, 2017 at 3:51 PM, Sasha Ostrikov <[email protected]> 
>>> wrote:
>>>
>>>> *Hi Shree,*
>>>> *I tried all options but nothing helps.*
>>>> *For example this is my traineddata folder:*
>>>>
>>>> *sasha@ds:~/dev/data$ ll /usr/local/share/tesseract-ocr/tessdata4.0/*
>>>> total 148
>>>> drwxr-xr-x 4 root root  4096 Nov 22 18:43 ./
>>>> drwxr-xr-x 4 root root  4096 Nov 26 10:29 ../
>>>> drwxr-xr-x 2 root root  4096 Nov 22 16:36 configs/
>>>> -rwxr-xr-x 1 root root 32291 Nov 22 18:43 eng.traineddata*
>>>> -rwxr-xr-x 1 root root 32292 Nov 22 18:43 fra.traineddata*
>>>> -rwxr-xr-x 1 root root 32324 Nov 22 18:42 Hebrew.traineddata*
>>>> -rwxr-xr-x 1 root root 31001 Nov 22 18:43 heb.traineddata*
>>>> -rwxr-xr-x 1 root root   572 Nov 22 16:36 pdf.ttf*
>>>> drwxr-xr-x 2 root root  4096 Nov 22 16:36 tessconfigs/
>>>>
>>>> *trained data was downloaded from 
>>>> here: https://github.com/tesseract-ocr/tessdata_best 
>>>> <https://github.com/tesseract-ocr/tessdata_best>*
>>>>
>>>> when I run this command this is what I get:
>>>> *sasha@ds:~/dev/data$ tesseract --tessdata-dir 
>>>> /usr/local/share/tesseract-ocr/tessdata4.0  text2.png text2.txt  --oem 3 
>>>> --psm 6 -l eng*
>>>> Error opening data file 
>>>> /usr/local/share/tesseract-ocr/tessdata4.0/eng.traineddata
>>>> Please make sure the TESSDATA_PREFIX environment variable is set to 
>>>> your "tessdata" directory.
>>>> Failed loading language 'eng'
>>>> Tesseract couldn't load any languages!
>>>> Could not initialize tesseract.
>>>>
>>>> I'm running on ubuntu 16 and this is my* tesseract -v*
>>>> tesseract 4.00.00dev-694-gebbfc3a
>>>>  leptonica-1.74.4
>>>>   libjpeg 8d (libjpeg-turbo 1.5.0) : libpng 1.6.25 : libtiff 4.0.6 : 
>>>> zlib 1.2.8
>>>>
>>>>  Found AVX
>>>>  Found SSE
>>>>
>>>> :(
>>>>
>>>>
>>>> On Friday, December 22, 2017 at 1:01:35 PM UTC+2, shree wrote:
>>>>>
>>>>> As per your message above
>>>>> The files are in   /usr/local/share/tessdata/
>>>>> but program is looking for them at /usr/local/share/
>>>>>
>>>>> you can set TESSDATA_PREFIX and try
>>>>>
>>>>> OR 
>>>>>
>>>>> specify the directory as part of the command line. I have found that 
>>>>> to be the easiest way, specially when using/comparing diff kinds of 
>>>>> traineddata (fast, best, legacy ...)
>>>>>
>>>>> example script below
>>>>>
>>>>> -------
>>>>>
>>>>> #!/bin/bash
>>>>> img_files=$(ls ./Cap*.png)
>>>>> for img_file in ${img_files}; do
>>>>>   echo "****************************" ${img_file} 
>>>>> "**********************************"
>>>>>     time tesseract --tessdata-dir 
>>>>> /mnt/c/Users/User/shree/tessdata_best/   ${img_file} 
>>>>> ${img_file%.*}-eng-best  --oem 1 --psm 6 -l eng
>>>>>     time tesseract --tessdata-dir 
>>>>> /mnt/c/Users/User/shree/tessdata_fast/   ${img_file} 
>>>>> ${img_file%.*}-eng-fast  --oem 1 --psm 6 -l eng
>>>>>     time tesseract --tessdata-dir /mnt/c/Users/User/shree/tessdata/  
>>>>>  ${img_file} ${img_file%.*}-engplus  --oem 1 --psm 6 -l engplus
>>>>> done
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ShreeDevi
>>>>> ____________________________________________________________
>>>>> भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com
>>>>>
>>>>> On Wed, Dec 20, 2017 at 8:49 PM, Sasha Ostrikov <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> *Yes tried that. this is the output - same sh*t :(*
>>>>>>
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ ll 
>>>>>> /usr/local/share/tessdata/
>>>>>> total 148
>>>>>> drwxr-xr-x  4 root root  4096 Dec 20 15:15 ./
>>>>>> drwxr-xr-x 10 root root  4096 Dec 20 15:14 ../
>>>>>> drwxr-xr-x  2 root root  4096 Dec 20 15:15 configs/
>>>>>> -rwxr-xr-x  1 root root 32291 Dec 20 15:15 eng.traineddata*
>>>>>> -rwxr-xr-x  1 root root 32292 Dec 20 15:15 fra.traineddata*
>>>>>> -rwxr-xr-x  1 root root 32324 Dec 20 15:15 Hebrew.traineddata*
>>>>>> -rwxr-xr-x  1 root root 31001 Dec 20 15:15 heb.traineddata*
>>>>>> -rwxr-xr-x  1 root root   572 Dec 20 15:15 pdf.ttf*
>>>>>> drwxr-xr-x  2 root root  4096 Dec 20 15:15 tessconfigs/
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ 
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ 
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ 
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ 
>>>>>> $TESSDATA_PREFIX
>>>>>> bash: /usr/local/share/tessdata: Is a directory
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ 
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ 
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ 
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract 
>>>>>> text2.png t1.txt -l eng --oem 0
>>>>>> Error opening data file /usr/local/share/eng.traineddata
>>>>>> Please make sure the TESSDATA_PREFIX environment variable is set to 
>>>>>> your "tessdata" directory.
>>>>>> Failed loading language 'eng'
>>>>>> Tesseract couldn't load any languages!
>>>>>> Could not initialize tesseract.
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract 
>>>>>> text2.png t1.txt -l eng --oem 1
>>>>>> Error opening data file /usr/local/share/eng.traineddata
>>>>>> Please make sure the TESSDATA_PREFIX environment variable is set to 
>>>>>> your "tessdata" directory.
>>>>>> Failed loading language 'eng'
>>>>>> Tesseract couldn't load any languages!
>>>>>> Could not initialize tesseract.
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract 
>>>>>> text2.png t1.txt -l eng --oem 2
>>>>>> Error opening data file /usr/local/share/eng.traineddata
>>>>>> Please make sure the TESSDATA_PREFIX environment variable is set to 
>>>>>> your "tessdata" directory.
>>>>>> Failed loading language 'eng'
>>>>>> Tesseract couldn't load any languages!
>>>>>> Could not initialize tesseract.
>>>>>> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract 
>>>>>> text2.png t1.txt -l eng --oem 3
>>>>>> Error opening data file /usr/local/share/eng.traineddata
>>>>>> Please make sure the TESSDATA_PREFIX environment variable is set to 
>>>>>> your "tessdata" directory.
>>>>>> Failed loading language 'eng'
>>>>>> Tesseract couldn't load any languages!
>>>>>> Could not initialize tesseract.
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "tesseract-ocr" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> To post to this group, send email to [email protected].
>>>>>> Visit this group at https://groups.google.com/group/tesseract-ocr.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/c11d3337-48dc-4d1d-a621-c903573ca76d%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/c11d3337-48dc-4d1d-a621-c903573ca76d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "tesseract-ocr" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/tesseract-ocr.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/tesseract-ocr/87f03f87-3112-4ff7-b467-071bed187860%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/tesseract-ocr/87f03f87-3112-4ff7-b467-071bed187860%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/0bf9cc47-36dc-4aa7-a426-9ac92f3c5681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to