JackEasson / SLPNet_pytorch

SLPNet: Towards End-to-End Car License Plates Detection and Recognition Using Lightweight CNN
56 stars 13 forks source link

When I train on my own Dataset, the following problem appears, how can I solve it? #12

Open mia-zhu111 opened 2 years ago

mia-zhu111 commented 2 years ago
----- TRAINING - EPOCH 40 -----
LEARNING RATE:  0.0033786452453014168
    =>The average detection loss of epoch 40 is 0.6146
    =>The average recognition loss of epoch %d is None, didn't train
----- VALIDATING - EPOCH 40 -----
The validation mode is: detection only.
=> Precision:  0.0
=> Recall:  0.0
=> mGauss: 0.000

The reason for this is that I can't directly use my own Dataset for training? What parameters need to be adjusted? Thank you for your reply!

JackEasson commented 2 years ago

Maybe you can supply more details like training loss. If the loss decreases normally and naturally? And you can use test_demo.py to evaluate if your model has been trained successfully. And please ensure your dataset (training and validation) are set up properly, especially labels. PS: For convenience, you can use Chinese to reply.

JackEasson commented 2 years ago

You can also decrease the threshold of detection. I set it as 0.7, maybe it's too large. You can adjust as described in this issue: https://github.com/JackEasson/SLPNet_pytorch/issues/10

mia-zhu111 commented 2 years ago

You can also decrease the threshold of detection. I set it as 0.7, maybe it's too large. You can adjust as described in this issue: #10

loss可以降下来,数据集是按照角点 问题分析:检测部分应该没有问题,应该是车牌识别的训练部分出问题 1、train epoch: The average recognition loss of epoch %d is None, didn't train 2、validation epoch: The validation mode is:detection only 这种情况是因为某个参数没有调整吗?

JackEasson commented 2 years ago

detection only表示训练的仅仅是车牌检测部分。train.py中有两个参数reg_epochs和acc_threshold用来控制何时进行检测+识别的训练。你可以按以下三种种方式操作:

  1. 改小acc_threshold,比如0.5,这表示检测精度达到多少时才会加入识别分支 example: python train.py --savedir SLPNetweight --acc_threshold 0.5
  2. 直接赋值reg_epochs为一个整数(比如5),那么会从此epoch加入识别分支的训练 example: python train.py --savedir SLPNetweight --reg_epochs 5
  3. 假如模型的检测部分已经训练好了,可以直接赋值reg_epochs为0,第一个epoch就会自动加入识别分支的训练,重点要记得要用之前训练过一定epoch,具有一定车牌检测能力的SLPNet预训练模型(你的情况比较符合此项,你手头的模型应该检测部分已经训练的比较好了) example: python train.py --savedir SLPNetweight --reg_epochs 0 --pretrained xxx.pth