Arabic-OCR icon indicating copy to clipboard operation
Arabic-OCR copied to clipboard

error when running ocr.py

Open vuhungtvt2018 opened this issue 1 year ago • 2 comments

image please help me to reslove this problem.thank you!

vuhungtvt2018 avatar Mar 07 '23 09:03 vuhungtvt2018

Hey, i encountered the same issue, you can check in the model variable. It will get empty value because of wrong value initialised in location variable in load_model function. It should be location = 'src/models'.

mrunal2401 avatar Apr 14 '23 11:04 mrunal2401

Hi,

I've encountered a couple of issues while working on your project that I'd like to bring to your attention.

Issue 1: Outdated Dependencies

The project seems to be using an outdated version of scikit-learn. Specifically, it's trying to unpickle an MLPClassifier from scikit-learn version 0.22, while the current environment is running scikit-learn version 1.2.2. This version mismatch could potentially lead to breaking code or invalid results. You can find more information in the scikit-learn model persistence documentation.

Issue 2: IndexError in OCR.py

I've also encountered an IndexError in the OCR.py script. The error occurs at line 60, where the code attempts to split the image_path string. The error message suggests that the list index is out of range, which might indicate an issue with the structure of the image_path string or the way it’s being split.

Here's the traceback for your reference:

/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator MLPClassifier from version 0.22 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk.
  warnings.warn(
0% 0/2 [00:09<?, ?it/s]
Traceback (most recent call last):
  File "/content/Arabic-OCR/src/OCR.py", line 98, in <module>
    running_time.append(run(images_path))
  File "/content/Arabic-OCR/src/OCR.py", line 60, in run
    img_name = image_path.split('\\')[1].split('.')[0]
IndexError: list index out of range

I hope this information helps in resolving these issues. Please let me know if you need any further details.

DanialPahlavan avatar Jul 13 '24 13:07 DanialPahlavan