New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not getting accuracy on MMRecognition SAR Model Training #858
Comments
Hi @payal211 , can you share your config file? |
According to your log, it still needs 18 days to complete training. The accuracy is still very low and it probably has something to do with your hyperparameter configuration. FYI, we trained SAR on 48 GPUs, and you might scale down the learning rate accordingly. We have also provided the detailed log for reference https://download.openmmlab.com/mmocr/textrecog/sar/20210330_105728.log.json. As for data augmentation techniques, ABINet's pipeline is empirically effective in boosting the model's final performance. But using them won't necessarily reduce the convergence time. |
Here is attached config file, Thanks |
Hi @gaotongxiao, Thanks for the quick response and suggestion. |
Hi @payal211 |
Hi @Mountchicken, |
Hi @payal211 |
And there is a hiding bug in SAR. It can't recognize the number 0 and if every test image has 0 in its label, the accuracy will always be 0.00% |
Hi @Mountchicken
and any suggestion how to overcome this hiding bug in SAR? Thanks. |
Sorry for the late reply. It's ok to modify the dictionary in this way. Here is the bug: When calculating #self.idx2char.append(padding_token)
self.idx2char.insert(0, padding_token)
#self.padding_idx = len(self.idx2char) - 1
self.padding_idx = 0 |
Thank you so much @Mountchicken. |
Hi @Mountchicken & @gaotongxiao [23-03-2022 09:33] Then after 21st Epoch Accuracy is: Then After 45th Epoch Accuracy is: Then After 91th Epoch Accuracy is: 2022-03-28 06:06:50,483 - mmocr - INFO - Epoch(val) [91][3056] 0_word_acc: 0.8273, 0_word_acc_ignore_case: 0.8273, 0_word_acc_ignore_case_symbol: 0.8273, 0_char_recall: 0.9799, 0_char_precision: 0.9501, 0_1-N.E.D: 0.9679 and after 99th epoch still there's no more difference in Accuracy 2022-03-28 16:55:05,712 - mmocr - INFO - Epoch(val) [99][3056] 0_word_acc: 0.8273, 0_word_acc_ignore_case: 0.8273, 0_word_acc_ignore_case_symbol: 0.8273, 0_char_recall: 0.9799, 0_char_precision: 0.9501, 0_1-N.E.D: 0.9679 so is there Anything I am missing here? |
@payal211
|
Hi @Mountchicken, - Is it possible that there are some characters in your dataset that are not in DICT90? Could you please describe what's images in your dataset look like. The max decode sequence length is set to be 30 here, and your label length may exceed 30 and that can also cause such a phenomenon. BTW, your training batch size is small, only 8. Try a larger one after we solve this problem. |
here, is attached config for batch 64 and DICT36 classes, which I modified . |
Hi @payal211
python tools/recog_test_imgs.py {PATH_TO_YOUR_TEST_IMAGES} {PATH_TO_YOUR_TXT_FORMAT_LABEL} configs/textrecog/sar/sar_r31_parallel_decoder_custom_dataset_batch64.py {PATH_TO_CHECKPOINTS}
|
Hi @Mountchicken |
I trained CRNN Model but after the second epoch, loss_ctc and loss both went infinite. Thank you |
Hi @payal211 |
I had tested Both model SAR and CRNN and I am not able to recognize the TEXT with Good accuracy. Here I am sharing the accuracy log. Trained CRNN Model and checked accuracy at 421th epoch and here is the attached log file for this As of now CRNN model recognize only digits with very less score. Thank you |
Hi @payal211
|
Thanks. I will do needful. |
Hi @Mountchicken, I tried with your suggestion, but no luck. After 1200th epoch the accuracy result is in attached log file and I continuing till 2400th epoch, and log file is here, |
We are now in a bottleneck.
|
Yes, the above log file is about CRNN. so okay, I can give one more try again with SAR and repeat = 1 & without NormalizationOCR. Yes, I have same style test data as the training set. |
Hi @Mountchicken, I still unable to understand what the purpose of
The documentation define repeat as Correct me if am wrong. Say for example, if we set |
@balandongiv |
Thanks for the confirmation @Mountchicken . But, any particular reason to |
Sometimes this feature is needed when we train a model on a set of datasets with imbalanced sizes, where tiling the small dataset several times is the most straightforward way to alleviate the bias brought by the large ones. SAR is an example. |
Thanks for detail explanation @gaotongxiao |
HI @gaotongxiao
I am training Custom dataset for Text recognition using SAR Model. I have total 7K plus images for training. Can you please help me how long should I have to wait for trained model.
As of now it completed 65th epoch and the Accuracy matric at 65th epoch is as below:
2022-03-21 08:06:45,433 - mmocr - INFO - Epoch(val) [65][100] 0_word_acc: 0.0000, 0_word_acc_ignore_case: 0.0000, 0_word_acc_ignore_case_symbol: 0.0000, 0_char_recall: 0.1346, 0_char_precision: 0.1089, 0_1-N.E.D: 0.0776
As you can see precision and recall are very less.
Also can you please suggest any preprocessing technique which you are aware to achieve good accuracy with respect to text recognition task?
Here is the attached SS of training continuation:
The text was updated successfully, but these errors were encountered: