
pytorch模型加载参数的避坑问题
加载模型时候碰到了两个错误:**Missing key(s) in state_dict: Unexpected key(s) in state_dict****Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the**在模型加载的权重参数保存在.pth文件中。当模型运行时候是`以k-v的方式加载数据`(比如k1代表某个卷积conv1,v1代表其对应得参数)。所以当`缺少key值会报这个错











