【PyTorch】下载的预训练模型的保存位置(Windows)

保存位置

C:\Users\xxx\.cache\torch\hub\checkpoints\

xxx替换为你的用户名。

项目场景

迁移学习的时候一般需要用到预训练模型,那么预训练模型的保存位置是在哪呢?

示例代码

from torchvision import models
model = models.vgg19(pretrained=True)

这里以VGG19为例,只要把pretrained参数设置为True就会下载模型,而模型的保存位置是在C盘用户目录下的\.cache\torch\hub\checkpoints\

Downloading: "https://download.pytorch.org/models/vgg19-dcbb9e9d.pth" to C:\Users\ghgxj\.cache\torch\hub\checkpoints\vgg19-dcbb9e9d.pth

温馨提示

关于PyTorch中迁移学习的教程可以看我的这篇文章。

你可能感兴趣的:(pytorch,pytorch)