add Baidu warpctc option to reproduce CTC results of our paper. #209
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While we used Baidu warpctc in the paper, we use PyTorch CTC in this repository.
The main reason why we changed the Baidu warpctc into PyTorch CTC is that Baidu warpctc is not easy to use for PyTorch >= 1.2 (see here, maybe you can still install warpctc with PyTorch 1.5 from the source (see here), I did not check it though.).
(our initial codes used Baidu warpctc before PyTorch CTC was released.)
However, we found that the accuracy of PyTorch CTC apparently lower than Baidu warpctc in some results (ex. CRNN, about 1%).
And thus, reproducing the CRNN result of our paper was difficult.
This problem is related to PyTorch version and Baidu warpctc issue.
Sorry for the inconvenience.
To solve this problem,
The details are below.
Then run the train.py with
--baiduCTC
option as below.If the current_accuracy at 2000 iter is about 48~50%, Baidu warpctc is working right.
In the case of PyTorch CTCLoss, the current_accuracy at 2000 iter is about 45~46%.
We upload the pretrained model CRNN-BaiduCTC.pth (trained with
--baiduCTC
option which uses Baidu warpctc) and report the result of this model here.The results could be slightly different up to random seed, your computing environment, and etc.
Hope this model/result helps your project.
If you found some issues, please let us know.
Best.