【发布时间】:2019-05-09 17:28:06
【问题描述】:
我使用 pytorch 0.4.1 (GPU) 训练了 DENSENET161 模型,在测试环境中我必须在 pytorch 版本 0.4.0 (CPU) 中加载它。我已经在使用model.cpu()
但是当我加载静态字典model.load_state_dict(checkpoint['state_dict'])
我收到以下错误:
RuntimeError:为 DenseNet 加载 state_dict 时出错:意外 state_dict 中的键:“features.norm0.num_batches_tracked”, “features.denseblock1.denselayer1.norm1.num_batches_tracked”, “features.denseblock1.denselayer1.norm2.num_batches_tracked”, "features.denseblock1.denselayer2.norm1.num_batches_tracked",...
【问题讨论】:
标签: python deep-learning pytorch