pytorch模型初始化

import torchvision.models as models

resnet18 = models.resnet18()

alexnet = models.alexnet()

squeezenet = models.squeezenet1_0()

densenet = models.densenet_161()

 

import torchvision.models as models

#pretrained=True就可以使用预训练的模型

resnet18 = models.resnet18(pretrained=True)

alexnet = models.alexnet(pretrained=True)

 

torchvision.models.resnet50(pretrained=False, ** kwargs)

构建一个ResNet-50模型

  • pretrained (bool) – True, 返回在ImageNet上训练好的模型。

你可能感兴趣的:(pytorch模型初始化)