When I use tqdm
in screen
, it prints a new line indefinitely and unknown characters in the bar.
Epoch 0: 5%|�� | 255/5474 [03:31<1:12:09, 1.21it/s]
Epoch 0: 2%|� | 90/5474 [01:24<1:23:46, 1.07it/s]
Epoch 0: 2%|� | 89/5474 [01:23<1:23:57, 1.07it/s]
I used bash
as the default shell and added the following configurations
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
root@35573c9f245c:~/git/pytorch-openai-transformer-lm# cat ~/.screenrc
# ~/.screenrc
defshell -bash # dash makes it a login shell
The same code works well in other terminals.
Any hint over this problem? Thanks!
As you guessed, the problem is caused by the unknown characters. Running screen
in UTF-8 mode will solve that:
screen -U
When calling tqdm
, try to include argument ascii=True
in order to deal with screen
not being UTF-8 friendly. Something like below:
for item in tqdm(items, total=len(items), ascii=True):
pass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With