pytorch 花卉识别 模型加载

运用pytorch进行花卉的训练与预测
模型建立与训练
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# create model
model = create_model(num_classes=5).to(device)
# load model weights
model_weight_path = "./weights/model-49.pth"
torch.save(model.state_dict(),model_weight_path)
model.load_state_dict(torch.load(model_weight_path, map_location=device))
model.eval()
运行结果没有报异常,但是准确率很低,且不准,想知道如何提高正确率,是模型加载的方式不对吗?

参考下这个

你第六行在干吗?
先用model的初始值覆盖掉model-49.pth?然后从model-49.pth里面加载权重?那model的权重不还是初始值?那你训练的意义何在