保存位置
C:\Users\xxx\.cache\torch\hub\checkpoints\
- 1
xxx
替换为你的用户名。
项目场景
迁移学习的时候一般需要用到预训练模型,那么预训练模型的保存位置是在哪呢?
示例代码
from torchvision import models
model = models.vgg19(pretrained=True)
- 1
- 2
这里以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
- 1
温馨提示
关于PyTorch
中迁移学习的教程可以看我的这篇文章。
文章知识点与官方知识档案匹配,可进一步学习相关知识
Python入门技能树人工智能深度学习 284900 人正在系统学习中
所有评论(0)