kuangliu / pytorch-retinanet

RetinaNet in PyTorch
993 stars 249 forks source link

Undefined names: TOTAL_BAR_LENGTH, last_time, term_width #1

Closed cclauss closed 7 years ago

cclauss commented 7 years ago

Perhaps these four lines should not be commented out. https://github.com/kuangliu/pytorch-retinanet/blob/master/utils.py#L201-L204

flake8 testing of https://github.com/kuangliu/pytorch-retinanet on Python 2.7.13

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./utils.py:211:19: F821 undefined name 'TOTAL_BAR_LENGTH'
    cur_len = int(TOTAL_BAR_LENGTH*current/total)
                  ^

./utils.py:212:20: F821 undefined name 'TOTAL_BAR_LENGTH'
    rest_len = int(TOTAL_BAR_LENGTH - cur_len) - 1
                   ^

./utils.py:223:28: F821 undefined name 'last_time'
    step_time = cur_time - last_time
                           ^

./utils.py:235:20: F821 undefined name 'term_width'
    for i in range(term_width-int(TOTAL_BAR_LENGTH)-len(msg)-3):
                   ^

./utils.py:235:35: F821 undefined name 'TOTAL_BAR_LENGTH'
    for i in range(term_width-int(TOTAL_BAR_LENGTH)-len(msg)-3):
                                  ^

./utils.py:239:20: F821 undefined name 'term_width'
    for i in range(term_width-int(TOTAL_BAR_LENGTH/2)):
                   ^

./utils.py:239:35: F821 undefined name 'TOTAL_BAR_LENGTH'
    for i in range(term_width-int(TOTAL_BAR_LENGTH/2)):
                                  ^

7       F821 undefined name 'TOTAL_BAR_LENGTH'
kuangliu commented 7 years ago

Yes, comment them back. I believe progress_bar is not used here, comment them back or just delete the whole function. I'll fix it later. Thanks.