OCR-D / ocrd_all

Master repository which includes most other OCR-D repositories as submodules
MIT License
72 stars 17 forks source link

`make all` with Python 3.7 fails to build ocrd_detectron2 #291

Closed stweil closed 1 year ago

stweil commented 2 years ago

The build aborts with this error message:

ERROR: Could not find a version that satisfies the requirement detectron2>=0.6 (from versions: none)

I could fix it locally in the main venv (no need to use sub-venv/headless-torch14) using these commands:

cd ocrd_detectron2
pip install 'git+https://github.com/facebookresearch/detectron2.git'
pip install -r requirements.txt
pip install .

Building detectron2 instead of trying to get (non-existing) pre-built packages would also support more platforms which currently would also fail (non Linux hosts, non x86_64 architectures).

bertsky commented 2 years ago

Building detectron2 instead of trying to get (non-existing) pre-built packages would also support more platforms which currently would also fail (non Linux hosts, non x86_64 architectures).

That does not work in general though. (You have to accommodate Python, Pytorch and Detectron versions against each other. Even the official setup manual does not do it this way.) Plus it will take very long. (Plus we might not want to depend on unstable master.)

stweil commented 2 years ago

Did you try it? It does not take long in my build (only a few seconds), and it works for Python 3.7, 3.9 and 3.10 (I did not test 3.8). For Python 3.6 we'd have to use the current rules.

And sure, for production we should add a specific tag to the GitHub URL. That's easy.