Open xyang70 opened 5 years ago
The problem happens in pybert\train\trainer.py in line 92 and 152: for metric in self.epoch_metrics: metric(logits=self.outputs, target=self.targets) value = metric.value() -> if value: change this to: if value is not None: original version judged score of 0 as null.
Epoch: 2 - loss: 0.2649 - valid_loss: 0.2187
Traceback (most recent call last): File "train_bert_multi_label.py", line 144, in
main()
File "train_bert_multi_label.py", line 138, in main
trainer.train(train_data = train_loader,valid_data=valid_loader)
File "/content/gdrive/My Drive/Bert/pybert/train/trainer.py", line 181, in train
self.training_monitor.epoch_step(logs)
File "/content/gdrive/My Drive/Bert/pybert/callback/trainingmonitor.py", line 62, in epochstep
plt.plot(N, self.H[f"valid{key}"],label=f"valid_{key}")
KeyError: 'valid_f1'
When I get to the 2nd epoch, I got this, the kernel crashes and the f1 score is not being calculated anymore. Do you know what the cause might be? Thanks.