pytorch迁移学习

from torchvision import models

model
= models.alexnet(pretrained=True) # 提取fc层中固定的参数(这一层的输入节点数目 fc_features = model.fc.in_features # 修改类别为9,(直接对类的属性进行修改) model.fc = nn.Linear(fc_features, n_class)
原文地址:https://www.cnblogs.com/youmuchen/p/14505382.html