diff --git a/torchreid/utils/tools.py b/torchreid/utils/tools.py index 518fa1886..2ccf63ab0 100644 --- a/torchreid/utils/tools.py +++ b/torchreid/utils/tools.py @@ -83,7 +83,7 @@ def _reporthook(count, block_size, total_size): 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' %