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 when running ocr.py #23

Open
vuhungtvt2018 opened this issue Mar 7, 2023 · 3 comments
Open

error when running ocr.py #23

vuhungtvt2018 opened this issue Mar 7, 2023 · 3 comments

Comments

@vuhungtvt2018
Copy link

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

@mrunal2401
Copy link

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'.

@DanialPahlavan
Copy link

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.

@zMuh
Copy link

zMuh commented Nov 22, 2024

i have the same issue here

Traceback (most recent call last):
File "/content/Arabic-OCR/src/OCR.py", line 98, in
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

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