我正在尝试在不打开 Internet 的情况下在 Kaggle 内核中加载一个 densenet121 模型。我已经完成了所需的步骤,例如将预训练的权重添加到我的输入目录并将其移动到“.cache/torch/checkpoints/”。它仍然无法正常工作并引发 gaierror。
以下是代码片段:
!mkdir -p /tmp/.cache/torch/checkpoints
!cp ../input/fastai-pretrained-models/densenet121-a639ec97.pth /tmp/.cache/torch/checkpoints/densenet121-a639ec97.pth
learn_cd = create_cnn(data_cd, models.densenet121, metrics=[error_rate, accuracy],model_dir = Path('../kaggle/working/models'),path=Path('.'),).to_fp16()
我已经为此苦苦挣扎了很长时间。任何帮助都会非常有帮助