报错原因:
保存模型时应是:
torch.save(model.state_dict(), model_path)
如果写成:
torch.save(model.state_dict, model_path)
就会报错:
state_dict = state_dict.copy()
AttributeError: 'function' object has no attribute 'copy'
报错原因:
保存模型时应是:
torch.save(model.state_dict(), model_path)
如果写成:
torch.save(model.state_dict, model_path)
就会报错:
state_dict = state_dict.copy()
AttributeError: 'function' object has no attribute 'copy'