Update tools.py
If you don't use the condition expression speed may be 0 initially deep-person-reid-master\torchreid\utils\tools.py", line 86, in _reporthook speed = int(progress_size / (1024*duration)) ZeroDivisionError: float division by zeropull/519/head
parent
91b032f392
commit
be55021c57
|
@ -83,7 +83,7 @@ def download_url(url, dst):
|
|||
return
|
||||
duration = time.time() - start_time
|
||||
progress_size = int(count * block_size)
|
||||
speed = int(progress_size / (1024*duration))
|
||||
speed = 0 if duration == 0 else int(progress_size / (1024*duration))
|
||||
percent = int(count * block_size * 100 / total_size)
|
||||
sys.stdout.write(
|
||||
'\r...%d%%, %d MB, %d KB/s, %d seconds passed' %
|
||||
|
|
Loading…
Reference in New Issue