-
Notifications
You must be signed in to change notification settings - Fork 477
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
Crash when running ocr_predictor #1871
Comments
Hi @decisivemoment64 👋 , Thanks for reporting 👍 Sounds a bit weird to be honest 😅 Do you have enough free space on your device and a stable internet connection ? |
Thank you for the quick reply! I have more than 100 Go available, could that be too little? I think that my internet connection is fine |
That's more as enough ! We store the downloaded models in |
Unfortunately deleting the folder didn't work! EDIT: I tried uninstalling everything and reinstalling with the latest version of Python. Now IDLE does not become unresponsive but the downloading speed gets slower and slower at each iteration (down to less than 20it/s). It keeps going but it is so slow that it's only 12% after running for half an hour. |
It's also more than enough 😅 Sounds all really weird... Could you please try https://github.com/felixdittrich92/OnnxTR and respond if the same behaviour happens ? |
Yes, same behavior... However, to add to the weirdness, I noticed that how far I could go in the download before it slowed down dramatically depended on the internet network as was connected to 🤔 |
I dug a bit further and it turns out that the problem stems from the update of the progress bar in the tqdm package. I replicated the _urlretrieve function and arguments to try to download the pretrained model file. It works perfectly if I comment out the command "pbar.update(chunk_size)", but it bugs if I keep it. |
Hi @decisivemoment64 👋 Thanks for the update ... sounds like an issue with python's multiproc on your Mac machine .. but unfortunately I don't think there is anything we could do from our end.. Another thing you could try is how it looks with downloading the models from the HF hub. For example: from doctr.io import DocumentFile
from doctr.models import ocr_predictor, from_hub
image = DocumentFile.from_images(['data/example.jpg'])
# Load a custom detection model from huggingface hub
det_model = from_hub('Felix92/doctr-torch-db-mobilenet-v3-large')
# Load a custom recognition model from huggingface hub
reco_model = from_hub('Felix92/doctr-torch-crnn-mobilenet-v3-large-french')
# You can easily plug in this models to the OCR predictor
predictor = ocr_predictor(det_arch=det_model, reco_arch=reco_model)
result = predictor(image) |
Bug description
Hello,
Python crashes when I run ocr_predictor() (whatever the arguments). I can see the download advancement until about 28%, then Python is unresponsive. I run it on a MacBook Pro (M1).
Sorry if I'm just doing something wrong, and thank you for your help!
Code snippet to reproduce the bug
Error traceback
No error message, but the application is unresponsive.
Environment
DocTR version: v0.11.0
TensorFlow version: 2.18.0
PyTorch version: 2.6.0 (torchvision 0.21.0)
OpenCV version: 4.11.0
OS: Mac OSX 15.0
Python version: 3.12.6
Is CUDA available (TensorFlow): No
Is CUDA available (PyTorch): No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Deep Learning backend
The text was updated successfully, but these errors were encountered: