#1 打印预训练模型
for name, param in model.named_parameters():
if param.requires_grad:
print(name)
或者是:
model.load_state_dict(torch.load(opt.pretrained_path))
print(model.state_dict().key())
#1 打印预训练模型
for name, param in model.named_parameters():
if param.requires_grad:
print(name)
或者是:
model.load_state_dict(torch.load(opt.pretrained_path))
print(model.state_dict().key())