Skip to content

Upgrade to TensorFlow 2.17 and Keras 3.0#180

Merged
lfoppiano merged 61 commits intomasterfrom
tensorflow-2.17
Mar 3, 2026
Merged

Upgrade to TensorFlow 2.17 and Keras 3.0#180
lfoppiano merged 61 commits intomasterfrom
tensorflow-2.17

Conversation

@kermitt2
Copy link
Owner

  • Upgrade to TF 2.17
  • Ensure it works with new Keras 3.0 in legacy mode 2.0

To do, update current models which are not compatible with TF 2.17.

In the future, support Keras 3.0, in particular the custom CRF layer.

@lfoppiano
Copy link
Collaborator

lfoppiano commented May 19, 2025

@kermitt2 in the following weeks I'm going to work on integrating this branch in the grobid master, so that we can move up to more recent tensorflow's version. I hope I did not break anything with my last merge. 😅

Which python version are you using?

@kermitt2
Copy link
Owner Author

I am using Python 3.12.3, which is the minimal requirement for 2.17 (>=12.3).
There will be models retraining needed.
In Grobid, I created a branch to support this branch - this is a breaking change for Grobid too, due to Keras 3 specific initialization.

@lfoppiano
Copy link
Collaborator

@kermitt2 I've merged the following changes:

  • configuration of nb_workers, it seemed causing problems with LInux and GPUs
  • Breaking change: removed pickled arrays in the LMDB storage
  • Fixed the LMDB access using multiple workers
  • Added scripts for running training and training/evaluation on a SLURM cluster
  • Fix issue with tensorflow and pytorch being built on different cuda versions. Now everything should work with cuda 12
  • Fixed classification classes and completed migration to tensorflow 2.17
  • Added re-trained models according with our formula (train and re-train with --incremental)

# Conflicts:
#	delft/applications/datasetTagger.py
#	delft/applications/nerTagger.py
#	delft/sequenceLabelling/data_generator.py
#	delft/sequenceLabelling/preprocess.py
#	delft/sequenceLabelling/trainer.py
#	delft/sequenceLabelling/wrapper.py
#	delft/utilities/Embeddings.py
#	delft/utilities/misc.py
Signed-off-by: Luca Foppiano <luca@foppiano.org>
Signed-off-by: Luca Foppiano <luca@foppiano.org>
@lfoppiano lfoppiano merged commit ef5740d into master Mar 3, 2026
2 checks passed
@lfoppiano lfoppiano deleted the tensorflow-2.17 branch March 3, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants