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
ecce8572
Commit
ecce8572
authored
Dec 19, 2018
by
pangjm
Browse files
add resnext related urls
parent
514b8f8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
mmcv/runner/checkpoint.py
mmcv/runner/checkpoint.py
+5
-1
mmcv/runner/runner.py
mmcv/runner/runner.py
+3
-0
mmcv/runner/urls.py
mmcv/runner/urls.py
+7
-0
No files found.
mmcv/runner/checkpoint.py
View file @
ecce8572
...
@@ -69,7 +69,7 @@ def load_checkpoint(model,
...
@@ -69,7 +69,7 @@ def load_checkpoint(model,
Args:
Args:
model (Module): Module to load checkpoint.
model (Module): Module to load checkpoint.
filename (str): Either a filepath or URL or modelzo
ll
://xxxxxxx.
filename (str): Either a filepath or URL or modelzo
o
://xxxxxxx.
map_location (str): Same as :func:`torch.load`.
map_location (str): Same as :func:`torch.load`.
strict (bool): Whether to allow different params for the model and
strict (bool): Whether to allow different params for the model and
checkpoint.
checkpoint.
...
@@ -83,6 +83,10 @@ def load_checkpoint(model,
...
@@ -83,6 +83,10 @@ def load_checkpoint(model,
from
torchvision.models.resnet
import
model_urls
from
torchvision.models.resnet
import
model_urls
model_name
=
filename
[
11
:]
model_name
=
filename
[
11
:]
checkpoint
=
model_zoo
.
load_url
(
model_urls
[
model_name
])
checkpoint
=
model_zoo
.
load_url
(
model_urls
[
model_name
])
elif
filename
.
startswith
(
'open-mmlab://'
):
from
.urls
import
open_mmlab_model_urls
model_name
=
filename
[
13
:]
checkpoint
=
model_zoo
.
load_url
(
open_mmlab_model_urls
[
model_name
])
elif
filename
.
startswith
((
'http://'
,
'https://'
)):
elif
filename
.
startswith
((
'http://'
,
'https://'
)):
checkpoint
=
model_zoo
.
load_url
(
filename
)
checkpoint
=
model_zoo
.
load_url
(
filename
)
else
:
else
:
...
...
mmcv/runner/runner.py
View file @
ecce8572
...
@@ -262,6 +262,9 @@ class Runner(object):
...
@@ -262,6 +262,9 @@ class Runner(object):
self
.
call_hook
(
'after_train_iter'
)
self
.
call_hook
(
'after_train_iter'
)
self
.
_iter
+=
1
self
.
_iter
+=
1
print
(
'**max cached: {}
\n
'
.
format
(
torch
.
cuda
.
max_memory_cached
()))
print
(
'**max allocated: {}
\n
'
.
format
(
torch
.
cuda
.
max_memory_allocated
()))
self
.
call_hook
(
'after_train_epoch'
)
self
.
call_hook
(
'after_train_epoch'
)
self
.
_epoch
+=
1
self
.
_epoch
+=
1
...
...
mmcv/runner/urls.py
0 → 100644
View file @
ecce8572
open_mmlab_model_urls
=
{
'vgg16_caffe'
:
'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/vgg16_caffe-292e1171.pth'
,
'resnet50_caffe'
:
'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/resnet50_caffe-788b5fa3.pth'
,
'resnet101_caffe'
:
'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/resnet101_caffe-3ad79236.pth'
,
'resnext101_32x4d'
:
'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/resnext101_32x4d-a5af3160.pth'
,
'resnext101_64x4d'
:
'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/resnext101_64x4d-ee2c6f71.pth'
}
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