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
mmdetection3d
Commits
e39d1984
Unverified
Commit
e39d1984
authored
Jun 10, 2021
by
Ziyi Wu
Committed by
GitHub
Jun 10, 2021
Browse files
[Fix] Fix potential bug in using `analyze_logs` (#634)
* fix when killing before eval * fix resume log
parent
63bdad98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
tools/analysis_tools/analyze_logs.py
tools/analysis_tools/analyze_logs.py
+12
-1
No files found.
tools/analysis_tools/analyze_logs.py
View file @
e39d1984
...
@@ -53,10 +53,21 @@ def plot_curve(log_dicts, args):
...
@@ -53,10 +53,21 @@ def plot_curve(log_dicts, args):
f
'
{
args
.
json_logs
[
i
]
}
does not contain metric
{
metric
}
'
)
f
'
{
args
.
json_logs
[
i
]
}
does not contain metric
{
metric
}
'
)
if
args
.
mode
==
'eval'
:
if
args
.
mode
==
'eval'
:
xs
=
np
.
arange
(
args
.
interval
,
max
(
epochs
)
+
1
,
args
.
interval
)
# if current training is resumed from previous checkpoint
# we lost information in early epochs
# `xs` should start according to `min(epochs)`
x0
=
min
(
epochs
)
+
args
.
interval
-
min
(
epochs
)
%
args
.
interval
xs
=
np
.
arange
(
x0
,
max
(
epochs
)
+
1
,
args
.
interval
)
ys
=
[]
ys
=
[]
for
epoch
in
epochs
[
args
.
interval
-
1
::
args
.
interval
]:
for
epoch
in
epochs
[
args
.
interval
-
1
::
args
.
interval
]:
ys
+=
log_dict
[
epoch
][
metric
]
ys
+=
log_dict
[
epoch
][
metric
]
# if training is aborted before eval of the last epoch
# `xs` and `ys` will have different length and cause an error
# check if `ys[-1]` is empty here
if
not
log_dict
[
epoch
][
metric
]:
xs
=
xs
[:
-
1
]
ax
=
plt
.
gca
()
ax
=
plt
.
gca
()
ax
.
set_xticks
(
xs
)
ax
.
set_xticks
(
xs
)
plt
.
xlabel
(
'epoch'
)
plt
.
xlabel
(
'epoch'
)
...
...
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