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
RODNet
Commits
39ad741a
Commit
39ad741a
authored
Feb 06, 2022
by
Yizhou Wang
Browse files
save loss_ave to checkpoint
parent
8568630b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
tools/train.py
tools/train.py
+6
-2
No files found.
tools/train.py
View file @
39ad741a
...
...
@@ -186,6 +186,8 @@ if __name__ == "__main__":
loss_cp
=
checkpoint
[
'loss'
]
if
'iter_count'
in
checkpoint
:
iter_count
=
checkpoint
[
'iter_count'
]
if
'loss_ave'
in
checkpoint
:
loss_ave
=
checkpoint
[
'loss_ave'
]
else
:
rodnet
.
load_state_dict
(
checkpoint
)
...
...
@@ -281,7 +283,8 @@ if __name__ == "__main__":
'iter'
:
iter
,
'model_state_dict'
:
rodnet
.
state_dict
(),
'optimizer_state_dict'
:
optimizer
.
state_dict
(),
'loss'
:
loss_confmap
,
'loss'
:
loss_confmap
.
item
(),
'loss_ave'
:
loss_ave
,
'iter_count'
:
iter_count
,
}
save_model_path
=
'%s/epoch_%02d_iter_%010d.pkl'
%
(
model_dir
,
epoch
+
1
,
iter_count
+
1
)
...
...
@@ -298,7 +301,8 @@ if __name__ == "__main__":
'iter'
:
iter
,
'model_state_dict'
:
rodnet
.
state_dict
(),
'optimizer_state_dict'
:
optimizer
.
state_dict
(),
'loss'
:
loss_confmap
,
'loss'
:
loss_confmap
.
item
(),
'loss_ave'
:
loss_ave
,
'iter_count'
:
iter_count
,
}
save_model_path
=
'%s/epoch_%02d_final.pkl'
%
(
model_dir
,
epoch
+
1
)
...
...
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