Skip to content
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

support training progress bar #320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The difference between our paper and ICDAR challenge is summarized [here](https:
In the paper, expriments were performed with **PyTorch 0.4.1, CUDA 9.0**.
- requirements : lmdb, pillow, torchvision, nltk, natsort
```
pip3 install lmdb pillow torchvision nltk natsort
pip3 install lmdb pillow torchvision nltk natsort tqdm
```

### Download lmdb dataset for traininig and evaluation from [here](https://www.dropbox.com/sh/i39abvnefllx2si/AAAbAYRvxzRp3cIE5HzqUw3ra?dl=0)
Expand Down
4 changes: 4 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import torch.optim as optim
import torch.utils.data
import numpy as np
from tqdm.auto import tqdm

from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, Averager
from dataset import hierarchical_dataset, AlignCollate, Batch_Balanced_Dataset
Expand Down Expand Up @@ -142,6 +143,7 @@ def train(opt):
best_norm_ED = -1
iteration = start_iter

pbar = tqdm(total=opt.num_iter)
while(True):
# train part
image_tensors, labels = train_dataset.get_batch()
Expand Down Expand Up @@ -224,6 +226,8 @@ def train(opt):
print('end the training')
sys.exit()
iteration += 1
pbar.update(1)
pbar.close()


if __name__ == '__main__':
Expand Down