projects
/
platform
/
upstream
/
caffeonacl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19028e7
)
fix a bug that time duration may be 0 when downloading model binary
author
gdh1995
<gdh1995@qq.com>
Tue, 10 Nov 2015 14:41:55 +0000
(22:41 +0800)
committer
gdh1995
<gdh1995@qq.com>
Wed, 11 Nov 2015 10:49:03 +0000
(18:49 +0800)
scripts/download_model_binary.py
patch
|
blob
|
history
diff --git
a/scripts/download_model_binary.py
b/scripts/download_model_binary.py
index
03a50f6
..
66f72f2
100755
(executable)
--- a/
scripts/download_model_binary.py
+++ b/
scripts/download_model_binary.py
@@
-18,7
+18,7
@@
def reporthook(count, block_size, total_size):
if count == 0:
start_time = time.time()
return
- duration =
time.time() - start_time
+ duration =
(time.time() - start_time) or 0.01
progress_size = int(count * block_size)
speed = int(progress_size / (1024 * duration))
percent = int(count * block_size * 100 / total_size)