bertsky/ocrd_detectron2

New installations are broken because of upstream issue for detectron2

Closed this issue · 7 comments

stweil commented

Building works, but running ocrd-detectron2-segment with make check raises an exception.

See related upstream issue facebookresearch/detectron2#5010.

Until upstream is fixed, pip install -U "pillow<10.0.0" helps.

Strange that this did not hit us in the Docker build (also Py38).

Since it's unlikely this will get fixed in detectron2 any time soon (last release is from 2021), but we do not use this anywhere else in ocrd_all, would you recommend adding pillow<10.0 here in requirements.txt?

stweil commented

Pillow 10.0.0 (which causes the breakage) was released on July 1, so it's not surprising that your or my previous builds passed fine. And yes, updating the requirements seems to be the only possible solution. Instead of updating the requirements (which would cause downgrades of pillow during the build process), it might be better to patch detectron2 after it was installed.

was released on July 1, so it's not surprising that your or my previous builds passed fine.

It is surprising – the latest Docker build is just 2h ago.

Instead of updating the requirements (which would cause downgrades of pillow during the build process), it might be better to patch detectron2 after it was installed.

I would not know how to do this (properly). Using make deps, Detectron2 gets pulled from git and then compiled as a temporary wheel before getting installed into the current venv...

I think I found a clean way.

Can you please try #28?

stweil commented

The pull requests #27 and #28 basically do the same thing to fix this issue. They only use slightly different ways to find the location of the installed detectron2 and to patch the code. It's your choice which one you prefer.

detectron2 was recently updated (July 6, 2023) so that this issue is now fixed. You should be able to use Pillow==10.0.0 now.

facebookresearch/detectron2@ff53992

Thanks @rayryeng for letting me know!

Unfortunately, we still require released version v0.6 here, and there has been no release since then for over 2 years. I cannot see what ramifications the switch to master would have for (the performance of) all the models that we redistribute here...