Traceback (most recent call last):
File "train_text_recognition.py", line 295, in <module>
trainer.run()
File "…/site-packages/chainer/training/trainer.py", line 313, in run
six.reraise(*sys.exc_info())
File "…/site-packages/six.py", line 693, in reraise
raise value
File "…/site-packages/chainer/training/trainer.py", line 299, in run
update()
File "…/site-packages/chainer/training/updater.py", line 223, in update
self.update_core()
File "…/site-packages/chainer/training/updaters/multiprocess_parallel_updater.py", line 207, in update_core
loss = _calc_loss(self._master, batch)
File "…/site-packages/chainer/training/updaters/multiprocess_parallel_updater.py", line 236, in _calc_loss
return model(*in_arrays)
File "…/see.git/chainer/utils/multi_accuracy_classifier.py", line 49, in __call__
reported_accuracies = self.accfun(self.y, t)
File "…/see.git/chainer/metrics/textrec_metrics.py", line 47, in calc_accuracy
word = "".join(map(self.label_to_char, word))
File "…/see.git/chainer/metrics/loss_metrics.py", line 182, in label_to_char
return chr(self.char_map[str(label)])
KeyError: '14'
(The actual number is different for each run.)
Is there a certain number of items I need to have in my charmap? ctc_char_map.json in "text_recognition_model" contains 52 keys.
And one related/follow-up question: If I use the original ctc_char_map.json training works but the model seems not recognize my test images. I ran the training for 10 epochs with 5000 images in my training set. How many images should I train (for how many epochs) to get somewhat good results?
Just for completeness - my train.csv looks like this:
I'm trying to get acquainted with the networks in this repo and I decided to start as simple as possible (text_recognition model).
I generated myself a custom dataset which only contains 8-digit "words" (cropped, no skew, no noise).
I generated my custom charmap like this:
so the final json is:
Now I'm trying to use it in my training:
This leads to an exception:
(The actual number is different for each run.)
Is there a certain number of items I need to have in my charmap?
ctc_char_map.json
in "text_recognition_model" contains 52 keys.And one related/follow-up question: If I use the original ctc_char_map.json training works but the model seems not recognize my test images. I ran the training for 10 epochs with 5000 images in my training set. How many images should I train (for how many epochs) to get somewhat good results?
Just for completeness - my train.csv looks like this: