Error when model checkpointing model if f1 is not available (yet)
bfreuden opened this issue · comments
The error is:
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/delft/sequenceLabelling/wrapper.py", line 124, in train
trainer.train(x_train, y_train, x_valid, y_valid)
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/delft/sequenceLabelling/trainer.py", line 61, in train
self.training_config.max_epoch)
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/delft/sequenceLabelling/trainer.py", line 109, in train_model
callbacks=callbacks)
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/keras/engine/training.py", line 1418, in fit_generator
initial_epoch=initial_epoch)
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/keras/engine/training_generator.py", line 251, in fit_generator
callbacks.on_epoch_end(epoch, epoch_logs)
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/keras/callbacks.py", line 79, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/opt/anaconda3/envs/delft-sug/lib/python3.6/site-packages/keras/callbacks.py", line 429, in on_epoch_end
filepath = self.filepath.format(epoch=epoch + 1, **logs)
KeyError: 'f1'
Unfortunately this f1 variable is created by keras so it does not seem to be possible to generate a default value in Delft.
Thank you, PR #57 is merged