seresnet152d_ra2-04464dd2.pth
PyTorch CNN
在线加载模型地址

确定自己使用的框架并导入对应的库。导入库实现样例代码可参考 文档中心-预训练模型使用教程

在代码中实现加载预训练模型地址

调用模型的实现方法

# path_pretrain = remote_helper.get_remote_data('https://www.flyai.com/m/resnest269-51ae5f19.pth')pretrain_dict = torch.load('./trained/seresnet152d_ra2-04464dd2.pth')

model_dict = self.net.state_dict()# # print(pretrain_dict.items())# # exit()

pretrain_dict = {k: v for k, v in pretrain_dict.items() if (k in model_dict)}model_dict.update(pretrain_dict)

self.net.load_state_dict(model_dict)