Commit ecce8572 authored by pangjm's avatar pangjm
Browse files

add resnext related urls

parent 514b8f8a
...@@ -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 modelzoll://xxxxxxx. filename (str): Either a filepath or URL or modelzoo://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:
......
...@@ -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
......
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'
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment