Support old models with deprecated keys
We have removed support for nnutils, so old models are no longer supported because they contain a key crnn.use_masks.
We need to check if this key exists and delete it if it does.
[2024-07-19 16:23:29,851 CRITICAL laia] Uncaught exception:
Traceback (most recent call last):
File "/home/users/starride/miniconda3/envs/pylaia_clean/bin/pylaia-htr-train-ctc", line 8, in <module>
sys.exit(main())
File "/home/users/starride/git_repos/pylaia/laia/scripts/htr/train_ctc.py", line 220, in main
run(**args)
File "/home/users/starride/git_repos/pylaia/laia/scripts/htr/train_ctc.py", line 58, in run
model = loader.load()
File "/home/users/starride/git_repos/pylaia/laia/common/loader.py", line 68, in load
model = super().load()
File "/home/users/starride/git_repos/pylaia/laia/common/loader.py", line 54, in load
return fn(*args, **kwargs)
TypeError: LaiaCRNN.__init__() got an unexpected keyword argument 'use_masks'