Calamari-OCR / calamari

Line based ATR Engine based on OCRopy
Apache License 2.0
1.04k stars 209 forks source link

calamari/1.0: hold Tensorflow and Protobuf dependencies #337

Closed bertsky closed 7 months ago

bertsky commented 1 year ago

IIUC ocrd_calamari just broke because of a new protobuf release. Looking at the requirements.txt for calamari-ocr==1.0.5 (the latest on that branch), it unconditionally requires tensorflow and protobuf.

Could we please restrict this, e.g. protobuf<4.0, to support 1.x a little longer?

@mikegerber you also mentioned problems with protobuf in Calamari 2 and Python 3.11, but I guess this is unrelated?

mikegerber commented 1 year ago

IIUC ocrd_calamari just broke because of a new protobuf release. Looking at the requirements.txt for calamari-ocr==1.0.5 (the latest on that branch), it unconditionally requires tensorflow and protobuf.

Could we please restrict this, e.g. protobuf<4.0, to support 1.x a little longer?

@mikegerber you also mentioned problems with protobuf in Calamari 2 and Python 3.11, but I guess this is unrelated?

Yes, with my latest tests I had to downgrade protobuf too, for Calamari 2. Couldn't tell which version was needed though. (Calamari 2 is on hold due to the licensing issues.)

mikegerber commented 1 year ago

I've worked around the issue in ocrd_calamari 1.0.6 by requiring protobuf < 4.0, but this should be fixed in Calamari 1.x itself (and in Calamari 2,x if there's still a problem - and only to repeat - we can't currently upgrade to 2.x due to the licensing issues #3)

bertsky commented 1 year ago

I've worked around the issue in ocrd_calamari 1.0.6 by requiring protobuf < 4.0

Oh, so you added this workaround for the protobuf dep and another workaround for the numpy deprecations.

So that means now ocrd_calamari and calamari-ocr versions will not be in sync anymore. Shouldn't we rather attempt to solve both problems upstream via PR on the calamari/1.0 branch and then ask for a v1.0.6 there?

mikegerber commented 10 months ago

I've worked around the issue in ocrd_calamari 1.0.6 by requiring protobuf < 4.0

Oh, so you added this workaround for the protobuf dep and another workaround for the numpy deprecations.

So that means now ocrd_calamari and calamari-ocr versions will not be in sync anymore. Shouldn't we rather attempt to solve both problems upstream via PR on the calamari/1.0 branch and then ask for a v1.0.6 there?

I've removed the numpy/protobuf workarounds in ocrd_calamari and depend on 1.0.x, >= 1.0.6 instead. Tested on Python 3.7-3.11.

(versions in sync? The versions are only accidently identical.)

mikegerber commented 10 months ago

I think this issue can be closed now.

bertsky commented 7 months ago

Indeed.

Thanks @andbue and @mikegerber!