hubconf.py 13.1 KB
Newer Older
L
lyuwenyu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

L
for hub  
lyuwenyu 已提交
15

L
lyuwenyu 已提交
16
dependencies = ['paddle', 'numpy']
L
for hub  
lyuwenyu 已提交
17

L
lyuwenyu 已提交
18
import paddle
L
for hub  
lyuwenyu 已提交
19

L
lyuwenyu 已提交
20 21
from ppcls.modeling.architectures import alexnet as _alexnet
from ppcls.modeling.architectures import vgg as _vgg 
L
lyuwenyu 已提交
22
from ppcls.modeling.architectures import resnet as _resnet 
L
lyuwenyu 已提交
23 24 25 26
from ppcls.modeling.architectures import squeezenet as _squeezenet
from ppcls.modeling.architectures import densenet as _densenet
from ppcls.modeling.architectures import inception_v3 as _inception_v3
from ppcls.modeling.architectures import inception_v4 as _inception_v4
L
lyuwenyu 已提交
27 28 29 30 31 32 33
from ppcls.modeling.architectures import googlenet as _googlenet
from ppcls.modeling.architectures import shufflenet_v2 as _shufflenet_v2
from ppcls.modeling.architectures import mobilenet_v1 as _mobilenet_v1
from ppcls.modeling.architectures import mobilenet_v2 as _mobilenet_v2
from ppcls.modeling.architectures import mobilenet_v3 as _mobilenet_v3
from ppcls.modeling.architectures import resnext as _resnext

L
lyuwenyu 已提交
34

L
lyuwenyu 已提交
35 36 37 38
def _load_pretrained_urls():
    '''Load pretrained model parameters url from README.md
    '''
    import re
L
lyuwenyu 已提交
39
    import os
L
lyuwenyu 已提交
40 41
    from collections import OrderedDict

L
lyuwenyu 已提交
42 43 44
    readme_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.md')

    with open(readme_path, 'r') as f:
L
lyuwenyu 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
        lines = f.readlines()
        lines = [lin for lin in lines if lin.strip().startswith('|') and 'Download link' in lin]
    
    urls = OrderedDict()
    for lin in lines:
        try:
            name = re.findall(r'\|(.*?)\|', lin)[0].strip().replace('<br>', '')
            url = re.findall(r'\((.*?)\)', lin)[-1].strip()
            if name in url:
                urls[name] = url
        except:
            pass

    return urls


_checkpoints = _load_pretrained_urls()
L
lyuwenyu 已提交
62

L
lyuwenyu 已提交
63

L
lyuwenyu 已提交
64 65 66 67 68 69
def _load_pretrained_parameters(model, name):
    assert name in _checkpoints, 'Not provide {} pretrained model.'.format(name)
    path = paddle.utils.download.get_weights_path_from_url(_checkpoints[name])
    model.set_state_dict(paddle.load(path))
    return model
    
L
lyuwenyu 已提交
70

L
lyuwenyu 已提交
71
def AlexNet(pretrained=False, **kwargs):
L
lyuwenyu 已提交
72 73 74 75
    '''AlexNet
    '''
    model = _alexnet.AlexNet(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
76
        model = _load_pretrained_parameters(model, 'AlexNet')
L
lyuwenyu 已提交
77 78 79 80 81

    return model



L
lyuwenyu 已提交
82
def VGG11(pretrained=False, **kwargs):
L
lyuwenyu 已提交
83 84 85 86
    '''VGG11
    '''
    model = _vgg.VGG11(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
87
        model = _load_pretrained_parameters(model, 'VGG11')
L
lyuwenyu 已提交
88 89 90 91

    return model


L
lyuwenyu 已提交
92
def VGG13(pretrained=False, **kwargs):
L
lyuwenyu 已提交
93 94 95 96
    '''VGG13
    '''
    model = _vgg.VGG13(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
97
        model = _load_pretrained_parameters(model, 'VGG13')
L
lyuwenyu 已提交
98 99 100 101

    return model


L
lyuwenyu 已提交
102
def VGG16(pretrained=False, **kwargs):
L
lyuwenyu 已提交
103 104 105 106
    '''VGG16
    '''
    model = _vgg.VGG16(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
107
        model = _load_pretrained_parameters(model, 'VGG16')
L
lyuwenyu 已提交
108 109 110 111

    return model


L
lyuwenyu 已提交
112
def VGG19(pretrained=False, **kwargs):
L
lyuwenyu 已提交
113 114 115 116
    '''VGG19
    '''
    model = _vgg.VGG19(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
117
        model = _load_pretrained_parameters(model, 'VGG19')
L
lyuwenyu 已提交
118 119 120 121 122 123

    return model




L
lyuwenyu 已提交
124
def ResNet18(pretrained=False, **kwargs):
L
lyuwenyu 已提交
125
    '''ResNet18
L
for hub  
lyuwenyu 已提交
126
    '''
L
lyuwenyu 已提交
127
    model = _resnet.ResNet18(**kwargs)
L
lyuwenyu 已提交
128
    if pretrained:
L
lyuwenyu 已提交
129
        model = _load_pretrained_parameters(model, 'ResNet18')
L
lyuwenyu 已提交
130

L
for hub  
lyuwenyu 已提交
131 132
    return model

L
lyuwenyu 已提交
133

L
lyuwenyu 已提交
134
def ResNet34(pretrained=False, **kwargs):
L
lyuwenyu 已提交
135 136
    '''ResNet34
    '''
L
lyuwenyu 已提交
137 138
    model = _resnet.ResNet34(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
139
        model = _load_pretrained_parameters(model, 'ResNet34')
L
lyuwenyu 已提交
140

L
lyuwenyu 已提交
141
    return model
L
lyuwenyu 已提交
142 143


L
lyuwenyu 已提交
144
def ResNet50(pretrained=False, **kwargs):
L
lyuwenyu 已提交
145 146 147 148
    '''ResNet50
    '''
    model = _resnet.ResNet50(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
149 150
        model = _load_pretrained_parameters(model, 'ResNet50')
        
L
lyuwenyu 已提交
151 152 153
    return model


L
lyuwenyu 已提交
154
def ResNet101(pretrained=False, **kwargs):
L
lyuwenyu 已提交
155 156 157 158
    '''ResNet101
    '''
    model = _resnet.ResNet101(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
159
        model = _load_pretrained_parameters(model, 'ResNet101')
L
lyuwenyu 已提交
160 161 162 163

    return model


L
lyuwenyu 已提交
164
def ResNet152(pretrained=False, **kwargs):
L
lyuwenyu 已提交
165 166 167 168
    '''ResNet152
    '''
    model = _resnet.ResNet152(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
169
        model = _load_pretrained_parameters(model, 'ResNet152')
L
lyuwenyu 已提交
170 171

    return model
L
lyuwenyu 已提交
172 173 174



L
lyuwenyu 已提交
175
def SqueezeNet1_0(pretrained=False, **kwargs):
L
lyuwenyu 已提交
176 177 178 179
    '''SqueezeNet1_0
    '''
    model = _squeezenet.SqueezeNet1_0(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
180
        model = _load_pretrained_parameters(model, 'SqueezeNet1_0')
L
lyuwenyu 已提交
181 182 183 184

    return model


L
lyuwenyu 已提交
185
def SqueezeNet1_1(pretrained=False, **kwargs):
L
lyuwenyu 已提交
186 187 188 189
    '''SqueezeNet1_1
    '''
    model = _squeezenet.SqueezeNet1_1(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
190
        model = _load_pretrained_parameters(model, 'SqueezeNet1_1')
L
lyuwenyu 已提交
191 192 193 194

    return model


L
lyuwenyu 已提交
195 196


L
lyuwenyu 已提交
197
def DenseNet121(pretrained=False, **kwargs):
L
lyuwenyu 已提交
198 199 200 201
    '''DenseNet121
    '''
    model = _densenet.DenseNet121(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
202
        model = _load_pretrained_parameters(model, 'DenseNet121')
L
lyuwenyu 已提交
203 204 205 206

    return model


L
lyuwenyu 已提交
207
def DenseNet161(pretrained=False, **kwargs):
L
lyuwenyu 已提交
208 209 210 211
    '''DenseNet161
    '''
    model = _densenet.DenseNet161(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
212
        model = _load_pretrained_parameters(model, 'DenseNet161')
L
lyuwenyu 已提交
213 214 215 216

    return model


L
lyuwenyu 已提交
217
def DenseNet169(pretrained=False, **kwargs):
L
lyuwenyu 已提交
218 219 220 221
    '''DenseNet169
    '''
    model = _densenet.DenseNet169(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
222
        model = _load_pretrained_parameters(model, 'DenseNet169')
L
lyuwenyu 已提交
223 224 225 226

    return model


L
lyuwenyu 已提交
227
def DenseNet201(pretrained=False, **kwargs):
L
lyuwenyu 已提交
228 229 230 231
    '''DenseNet201
    '''
    model = _densenet.DenseNet201(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
232
        model = _load_pretrained_parameters(model, 'DenseNet201')
L
lyuwenyu 已提交
233 234 235 236

    return model


L
lyuwenyu 已提交
237
def DenseNet264(pretrained=False, **kwargs):
L
lyuwenyu 已提交
238 239 240 241
    '''DenseNet264
    '''
    model = _densenet.DenseNet264(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
242
        model = _load_pretrained_parameters(model, 'DenseNet264')
L
lyuwenyu 已提交
243 244 245 246

    return model


L
lyuwenyu 已提交
247

L
lyuwenyu 已提交
248
def InceptionV3(pretrained=False, **kwargs):
L
lyuwenyu 已提交
249 250 251 252
    '''InceptionV3
    '''
    model = _inception_v3.InceptionV3(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
253
        model = _load_pretrained_parameters(model, 'InceptionV3')
L
lyuwenyu 已提交
254 255 256 257

    return model


L
lyuwenyu 已提交
258
def InceptionV4(pretrained=False, **kwargs):
L
lyuwenyu 已提交
259 260 261 262
    '''InceptionV4
    '''
    model = _inception_v4.InceptionV4(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
263
        model = _load_pretrained_parameters(model, 'InceptionV4')
L
lyuwenyu 已提交
264

L
lyuwenyu 已提交
265 266 267 268
    return model



L
lyuwenyu 已提交
269
def GoogLeNet(pretrained=False, **kwargs):
L
lyuwenyu 已提交
270 271 272 273
    '''GoogLeNet
    '''
    model = _googlenet.GoogLeNet(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
274
        model = _load_pretrained_parameters(model, 'GoogLeNet')
L
lyuwenyu 已提交
275 276 277 278 279

    return model



L
lyuwenyu 已提交
280
def ShuffleNet(pretrained=False, **kwargs):
L
lyuwenyu 已提交
281 282 283 284
    '''ShuffleNet
    '''
    model = _shufflenet_v2.ShuffleNet(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
285
        model = _load_pretrained_parameters(model, 'ShuffleNet')
L
lyuwenyu 已提交
286 287 288 289 290

    return model



L
lyuwenyu 已提交
291
def MobileNetV1(pretrained=False, **kwargs):
L
lyuwenyu 已提交
292 293 294 295
    '''MobileNetV1
    '''
    model = _mobilenet_v1.MobileNetV1(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
296
        model = _load_pretrained_parameters(model, 'MobileNetV1')
L
lyuwenyu 已提交
297 298 299 300

    return model


L
lyuwenyu 已提交
301
def MobileNetV1_x0_25(pretrained=False, **kwargs):
L
lyuwenyu 已提交
302 303 304 305
    '''MobileNetV1_x0_25
    '''
    model = _mobilenet_v1.MobileNetV1_x0_25(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
306
        model = _load_pretrained_parameters(model, 'MobileNetV1_x0_25')
L
lyuwenyu 已提交
307 308 309 310

    return model


L
lyuwenyu 已提交
311
def MobileNetV1_x0_5(pretrained=False, **kwargs):
L
lyuwenyu 已提交
312 313 314 315
    '''MobileNetV1_x0_5
    '''
    model = _mobilenet_v1.MobileNetV1_x0_5(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
316
        model = _load_pretrained_parameters(model, 'MobileNetV1_x0_5')
L
lyuwenyu 已提交
317 318 319 320

    return model


L
lyuwenyu 已提交
321
def MobileNetV1_x0_75(pretrained=False, **kwargs):
L
lyuwenyu 已提交
322 323 324 325
    '''MobileNetV1_x0_75
    '''
    model = _mobilenet_v1.MobileNetV1_x0_75(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
326
        model = _load_pretrained_parameters(model, 'MobileNetV1_x0_75')
L
lyuwenyu 已提交
327 328 329 330

    return model


L
lyuwenyu 已提交
331
def MobileNetV2_x0_25(pretrained=False, **kwargs):
L
lyuwenyu 已提交
332 333 334 335
    '''MobileNetV2_x0_25
    '''
    model = _mobilenet_v2.MobileNetV2_x0_25(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
336
        model = _load_pretrained_parameters(model, 'MobileNetV2_x0_25')
L
lyuwenyu 已提交
337 338 339 340

    return model


L
lyuwenyu 已提交
341
def MobileNetV2_x0_5(pretrained=False, **kwargs):
L
lyuwenyu 已提交
342 343 344 345
    '''MobileNetV2_x0_5
    '''
    model = _mobilenet_v2.MobileNetV2_x0_5(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
346
        model = _load_pretrained_parameters(model, 'MobileNetV2_x0_5')
L
lyuwenyu 已提交
347 348 349 350

    return model


L
lyuwenyu 已提交
351
def MobileNetV2_x0_75(pretrained=False, **kwargs):
L
lyuwenyu 已提交
352 353 354 355
    '''MobileNetV2_x0_75
    '''
    model = _mobilenet_v2.MobileNetV2_x0_75(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
356
        model = _load_pretrained_parameters(model, 'MobileNetV2_x0_75')
L
lyuwenyu 已提交
357 358 359 360

    return model


L
lyuwenyu 已提交
361
def MobileNetV2_x1_5(pretrained=False, **kwargs):
L
lyuwenyu 已提交
362 363 364 365
    '''MobileNetV2_x1_5
    '''
    model = _mobilenet_v2.MobileNetV2_x1_5(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
366
        model = _load_pretrained_parameters(model, 'MobileNetV2_x1_5')
L
lyuwenyu 已提交
367 368 369 370

    return model


L
lyuwenyu 已提交
371
def MobileNetV2_x2_0(pretrained=False, **kwargs):
L
lyuwenyu 已提交
372 373 374 375
    '''MobileNetV2_x2_0
    '''
    model = _mobilenet_v2.MobileNetV2_x2_0(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
376
        model = _load_pretrained_parameters(model, 'MobileNetV2_x2_0')
L
lyuwenyu 已提交
377 378 379 380

    return model


L
lyuwenyu 已提交
381
def MobileNetV3_large_x0_35(pretrained=False, **kwargs):
L
lyuwenyu 已提交
382 383 384 385
    '''MobileNetV3_large_x0_35
    '''
    model = _mobilenet_v3.MobileNetV3_large_x0_35(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
386
        model = _load_pretrained_parameters(model, 'MobileNetV3_large_x0_35')
L
lyuwenyu 已提交
387 388 389 390

    return model


L
lyuwenyu 已提交
391
def MobileNetV3_large_x0_5(pretrained=False, **kwargs):
L
lyuwenyu 已提交
392 393 394 395
    '''MobileNetV3_large_x0_5
    '''
    model = _mobilenet_v3.MobileNetV3_large_x0_5(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
396
        model = _load_pretrained_parameters(model, 'MobileNetV3_large_x0_5')
L
lyuwenyu 已提交
397 398 399 400

    return model


L
lyuwenyu 已提交
401
def MobileNetV3_large_x0_75(pretrained=False, **kwargs):
L
lyuwenyu 已提交
402 403 404 405
    '''MobileNetV3_large_x0_75
    '''
    model = _mobilenet_v3.MobileNetV3_large_x0_75(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
406
        model = _load_pretrained_parameters(model, 'MobileNetV3_large_x0_75')
L
lyuwenyu 已提交
407 408 409 410

    return model


L
lyuwenyu 已提交
411
def MobileNetV3_large_x1_0(pretrained=False, **kwargs):
L
lyuwenyu 已提交
412 413 414 415
    '''MobileNetV3_large_x1_0
    '''
    model = _mobilenet_v3.MobileNetV3_large_x1_0(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
416
        model = _load_pretrained_parameters(model, 'MobileNetV3_large_x1_0')
L
lyuwenyu 已提交
417 418 419 420

    return model


L
lyuwenyu 已提交
421
def MobileNetV3_large_x1_25(pretrained=False, **kwargs):
L
lyuwenyu 已提交
422 423 424 425
    '''MobileNetV3_large_x1_25
    '''
    model = _mobilenet_v3.MobileNetV3_large_x1_25(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
426
        model = _load_pretrained_parameters(model, 'MobileNetV3_large_x1_25')
L
lyuwenyu 已提交
427 428 429 430

    return model


L
lyuwenyu 已提交
431
def MobileNetV3_small_x0_35(pretrained=False, **kwargs):
L
lyuwenyu 已提交
432 433 434 435
    '''MobileNetV3_small_x0_35
    '''
    model = _mobilenet_v3.MobileNetV3_small_x0_35(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
436
        model = _load_pretrained_parameters(model, 'MobileNetV3_small_x0_35')
L
lyuwenyu 已提交
437 438 439 440

    return model


L
lyuwenyu 已提交
441
def MobileNetV3_small_x0_5(pretrained=False, **kwargs):
L
lyuwenyu 已提交
442 443 444 445
    '''MobileNetV3_small_x0_5
    '''
    model = _mobilenet_v3.MobileNetV3_small_x0_5(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
446
        model = _load_pretrained_parameters(model, 'MobileNetV3_small_x0_5')
L
lyuwenyu 已提交
447 448 449 450

    return model


L
lyuwenyu 已提交
451
def MobileNetV3_small_x0_75(pretrained=False, **kwargs):
L
lyuwenyu 已提交
452 453 454 455
    '''MobileNetV3_small_x0_75
    '''
    model = _mobilenet_v3.MobileNetV3_small_x0_75(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
456
        model = _load_pretrained_parameters(model, 'MobileNetV3_small_x0_75')
L
lyuwenyu 已提交
457 458 459 460

    return model


L
lyuwenyu 已提交
461
def MobileNetV3_small_x1_0(pretrained=False, **kwargs):
L
lyuwenyu 已提交
462 463 464 465
    '''MobileNetV3_small_x1_0
    '''
    model = _mobilenet_v3.MobileNetV3_small_x1_0(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
466
        model = _load_pretrained_parameters(model, 'MobileNetV3_small_x1_0')
L
lyuwenyu 已提交
467 468 469 470

    return model


L
lyuwenyu 已提交
471
def MobileNetV3_small_x1_25(pretrained=False, **kwargs):
L
lyuwenyu 已提交
472 473 474 475
    '''MobileNetV3_small_x1_25
    '''
    model = _mobilenet_v3.MobileNetV3_small_x1_25(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
476
        model = _load_pretrained_parameters(model, 'MobileNetV3_small_x1_25')
L
lyuwenyu 已提交
477 478 479 480

    return model


L
lyuwenyu 已提交
481

L
lyuwenyu 已提交
482
def ResNeXt101_32x4d(pretrained=False, **kwargs):
L
lyuwenyu 已提交
483 484 485 486
    '''ResNeXt101_32x4d
    '''
    model = _resnext.ResNeXt101_32x4d(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
487
        model = _load_pretrained_parameters(model, 'ResNeXt101_32x4d')
L
lyuwenyu 已提交
488 489 490 491

    return model


L
lyuwenyu 已提交
492
def ResNeXt101_64x4d(pretrained=False, **kwargs):
L
lyuwenyu 已提交
493 494 495 496
    '''ResNeXt101_64x4d
    '''
    model = _resnext.ResNeXt101_64x4d(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
497
        model = _load_pretrained_parameters(model, 'ResNeXt101_64x4d')
L
lyuwenyu 已提交
498 499 500 501

    return model


L
lyuwenyu 已提交
502
def ResNeXt152_32x4d(pretrained=False, **kwargs):
L
lyuwenyu 已提交
503 504 505 506
    '''ResNeXt152_32x4d
    '''
    model = _resnext.ResNeXt152_32x4d(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
507
        model = _load_pretrained_parameters(model, 'ResNeXt152_32x4d')
L
lyuwenyu 已提交
508 509 510 511

    return model


L
lyuwenyu 已提交
512
def ResNeXt152_64x4d(pretrained=False, **kwargs):
L
lyuwenyu 已提交
513 514 515 516
    '''ResNeXt152_64x4d
    '''
    model = _resnext.ResNeXt152_64x4d(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
517
        model = _load_pretrained_parameters(model, 'ResNeXt152_64x4d')
L
lyuwenyu 已提交
518 519 520 521

    return model


L
lyuwenyu 已提交
522
def ResNeXt50_32x4d(pretrained=False, **kwargs):
L
lyuwenyu 已提交
523 524 525 526
    '''ResNeXt50_32x4d
    '''
    model = _resnext.ResNeXt50_32x4d(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
527
        model = _load_pretrained_parameters(model, 'ResNeXt50_32x4d')
L
lyuwenyu 已提交
528 529 530 531

    return model


L
lyuwenyu 已提交
532
def ResNeXt50_64x4d(pretrained=False, **kwargs):
L
lyuwenyu 已提交
533 534 535 536
    '''ResNeXt50_64x4d
    '''
    model = _resnext.ResNeXt50_64x4d(**kwargs)
    if pretrained:
L
lyuwenyu 已提交
537
        model = _load_pretrained_parameters(model, 'ResNeXt50_64x4d')
L
lyuwenyu 已提交
538 539

    return model