Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
b34eef6e
"common/vscode:/vscode.git/clone" did not exist on "7de9c2660958b840087d8f7c201a934f1f7c7ec9"
Commit
b34eef6e
authored
Jan 02, 2020
by
Kevin
Committed by
Kai Chen
Jan 02, 2020
Browse files
fix ZeroDivisionError in progressbar (#162) (#163)
parent
0d00f1a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
mmcv/utils/progressbar.py
mmcv/utils/progressbar.py
+4
-1
No files found.
mmcv/utils/progressbar.py
View file @
b34eef6e
...
@@ -44,7 +44,10 @@ class ProgressBar(object):
...
@@ -44,7 +44,10 @@ class ProgressBar(object):
def
update
(
self
):
def
update
(
self
):
self
.
completed
+=
1
self
.
completed
+=
1
elapsed
=
self
.
timer
.
since_start
()
elapsed
=
self
.
timer
.
since_start
()
fps
=
self
.
completed
/
elapsed
if
elapsed
>
0
:
fps
=
self
.
completed
/
elapsed
else
:
fps
=
float
(
'inf'
)
if
self
.
task_num
>
0
:
if
self
.
task_num
>
0
:
percentage
=
self
.
completed
/
float
(
self
.
task_num
)
percentage
=
self
.
completed
/
float
(
self
.
task_num
)
eta
=
int
(
elapsed
*
(
1
-
percentage
)
/
percentage
+
0.5
)
eta
=
int
(
elapsed
*
(
1
-
percentage
)
/
percentage
+
0.5
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment