Python Forum

Full Version: Can't install tensorflow-addons with pip
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone! Smile

I'm trying to use DocTR ocr, and I'm having a lot of issues. Right now I'm not able to install tensorflow-addons. I write the command in the terminal, but nothing happens. It just freezes for a couple of seconds and then it ends without a result. I tried changing python versions but I got the same result with 3.9 and 3.8. I can't use 3.10 as it seems that it has some version incompatibilities with another module that I need to install to be able to use DocTR.
Im not getting an error so I don't know what is going on, but It's not getting installed also. I'd appreciate any help.

Thanks in advance!
Well, it seems that it WAS getting installed, but didn't show anything because it had a "-q" in the command.
"pip install -q tensorflow-addons"
I removed it and it shows that requirements are already satisfied. I'm still not able to use DocTr.

I get this message:
Quote:ModuleNotFoundError: DocTR requires either TensorFlow or PyTorch to be installed. Please ensure one of them is installed and that either USE_TF or USE_TORCH is enabled.



This is my code:

from doctr.io import DocumentFile
from doctr.models import ocr_predictor


model = ocr_predictor(pretrained=True)
document = DocumentFile.from_images("img2.jpeg")

result = model(document)
result.show(document)
I'm not sure also where to create my "main.py" file, as I had to clone the doctr git repository. I created it inside the doctr project folder.
A quick look at the docs and I do not see how to enable USE_TF. I believe that is the problem, sorry no solution.
(Sep-05-2022, 12:38 PM)jefsummers Wrote: [ -> ]A quick look at the docs and I do not see how to enable USE_TF. I believe that is the problem, sorry no solution.

Oh I see. I'll search info about that then. Thank you!