LPRNet_Pytorch icon indicating copy to clipboard operation
LPRNet_Pytorch copied to clipboard

Custom Training

Open fadi212 opened this issue 4 years ago • 8 comments

How can we train on custom data and can we train the same model on Number Plates with multiple lines like two or three

fadi212 avatar Aug 21 '19 11:08 fadi212

  1. if it is not chinese license plate and license plate lenth equal to 8, you should delete check(label) funtcion in LPRDataLoader.getitem;
  2. you should modify the list of CHARS base on your license plate characters, and the filename of train/test images should be its label character;
  3. T_length should be bigger or equal than twice max license plate lenth;
  4. our model not support multiple lines at currenct, maybe you can merge multiple lines into one line.

sirius-ai avatar Aug 21 '19 11:08 sirius-ai

2 'targets' to have scalar type Int; but got torch.cuda.FloatTensor instead (while checking arguments for ctc_loss_gpu)

2017TJM avatar Dec 26 '19 10:12 2017TJM

@2017TJM please let me know how to reproduce this issue, thanks!

sirius-ai avatar Jan 09 '20 06:01 sirius-ai

Hi , im getting below error while train when i change T_length = 24, since my dataset include Indian License Plate , with single and double line license plate.

File "LPRNet_Train.py", line 94, in loss = ctc_loss(log_probs, labels, input_lengths=input_lengths, target_lengths=target_lengths) File "/home/arohi/Gunjan/Python Programming/venv/lib/python3.5/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "/home/arohi/Gunjan/Python Programming/venv/lib/python3.5/site-packages/torch/nn/modules/loss.py", line 1295, in forward self.zero_infinity) File "/home/arohi/Gunjan/Python Programming/venv/lib/python3.5/site-packages/torch/nn/functional.py", line 1781, in ctc_loss zero_infinity) RuntimeError: Expected input_lengths to have value at most 18, but got value 24 (while checking arguments for ctc_loss_cpu)

MH02AS8015 MH02CB5249

gunjan5489 avatar Jan 28 '20 10:01 gunjan5489

Anybody to help with 2 lines and 1 line license plates?

anhthoai avatar Jul 11 '20 05:07 anhthoai

Have u solved the problem?

duorouputao avatar Aug 10 '21 09:08 duorouputao

Have u solved the problem?

the author has not done nothing relating to this issue

gunjan5489 avatar Aug 10 '21 10:08 gunjan5489

@sirius-ai
Thanks for such a great work!

what does T_length mean? i am confused with args.lpr_max_len

if I change lpr_max_len then output shape could change?

for now my output shape is [1,50,18] Korean Character 50 is class score nums. I want to make longer sequence than 18? is it available?

jeungmin717 avatar May 04 '23 05:05 jeungmin717