Arabic-OCR
Arabic-OCR copied to clipboard
error when running ocr.py
please help me to reslove this problem.thank you!
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'
.
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.