First,thank you for the code you provide.
I try to use your code to train for recognizing licence plate.
The char include
alphabet ="""ABCDEFGHJKLMNPQRSTUVWXYZ0123456789-"""
Sometimes the amount of plate number will be 7 or 8.
So I train with your code but got this Error , how do I fix? please~~~
若方便的話,中文回覆也可以~謝謝您
Traceback (most recent call last):
File "train.py", line 254, in <module>
cost = train(crnn, criterion, optimizer, train_iter)
File "train.py", line 242, in train
cost = criterion(preds, text, preds_size, length) / batch_size
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550,in __call__
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/loss.py", line 1311, in forward
self.zero_infinity)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py", line 2052, inctc_loss
zero_infinity)
RuntimeError: Expected tensor to have size at least 12 at dimension 1, but got size 8for argument #2 'targets' (while checking arguments for ctc_loss_gpu)
First,thank you for the code you provide. I try to use your code to train for recognizing licence plate. The char include alphabet ="""ABCDEFGHJKLMNPQRSTUVWXYZ0123456789-""" Sometimes the amount of plate number will be 7 or 8.
So I train with your code but got this Error , how do I fix? please~~~ 若方便的話,中文回覆也可以~謝謝您