Skip to content

Commit d1ce966

Browse files
committed
Fix logger
1 parent 0d14fc5 commit d1ce966

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lstm/ocr/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ def on_epoch_end(self, epoch, logs):
138138
truth = [''.join(self.dataset.mapping.get(label, '')
139139
for label in true).strip(' |_') for true in truth]
140140
pred_train = [''.join(self.dataset.mapping.get(label, '')
141-
for label in pred).strip(' |_') for pred in result]
141+
for label in pred).strip(' |_') for pred in result_train]
142142
truth_train = [''.join(self.dataset.mapping.get(label, '')
143143
for label in true).strip(' |_') for true in truth_train]
144144
dists = [lev(list(a), list(b)) for a, b in zip(pred, truth)]
145145
print("Val Levenstein: ", np.mean(dists))
146146
print("Val Examples:\n" +
147147
"\n".join([f"{t}\n{p}\n---" for p, t in zip(pred, truth)]))
148148
print("Train :\n" +
149-
"\n".join([f"{t}\n{p}\n---" for p, t in zip(pred, truth)]))
149+
"\n".join([f"{t}\n{p}\n---" for p, t in zip(pred_train, truth_train)]))
150150
wandb.log({"examples": [
151151
wandb.Image(img, caption=f"Pred: \"{pred[i]}\" -- Truth: \"{truth[i]}\"") for i, img in enumerate(images)],
152152
"train_examples": [

0 commit comments

Comments
 (0)