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
fd3f862e
Unverified
Commit
fd3f862e
authored
Dec 12, 2019
by
Kai Chen
Committed by
GitHub
Dec 12, 2019
Browse files
add an argument to skip os.symlink (#155)
parent
50d2cbdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mmcv/runner/runner.py
mmcv/runner/runner.py
+6
-4
No files found.
mmcv/runner/runner.py
View file @
fd3f862e
...
...
@@ -237,7 +237,8 @@ class Runner(object):
out_dir
,
filename_tmpl
=
'epoch_{}.pth'
,
save_optimizer
=
True
,
meta
=
None
):
meta
=
None
,
create_symlink
=
True
):
if
meta
is
None
:
meta
=
dict
(
epoch
=
self
.
epoch
+
1
,
iter
=
self
.
iter
)
else
:
...
...
@@ -245,11 +246,12 @@ class Runner(object):
filename
=
filename_tmpl
.
format
(
self
.
epoch
+
1
)
filepath
=
osp
.
join
(
out_dir
,
filename
)
linkpath
=
osp
.
join
(
out_dir
,
'latest.pth'
)
optimizer
=
self
.
optimizer
if
save_optimizer
else
None
save_checkpoint
(
self
.
model
,
filepath
,
optimizer
=
optimizer
,
meta
=
meta
)
# use relative symlink
mmcv
.
symlink
(
filename
,
linkpath
)
# in some environments, `os.symlink` is not supported, you may need to
# set `create_symlink` to False
if
create_symlink
:
mmcv
.
symlink
(
filename
,
osp
.
join
(
out_dir
,
'latest.pth'
))
def
train
(
self
,
data_loader
,
**
kwargs
):
self
.
model
.
train
()
...
...
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