python - 如何在 pytorch 中加载预训练的 googlenet 模型
问题描述
我正在尝试在特定数据集上微调 GoogleNet 网络,但我无法加载它。我现在尝试的是:
model = torchvision.models.googlenet(pretrained=True)
但是我收到一个错误:
AttributeError: module 'torchvision.models' has no attribute 'googlenet'
我有最新版本的 torchvision 但重新安装以确保错误仍然存在。
解决方案
您可以改用 GoogLeNetinception_v3
模型(“重新思考计算机视觉的初始架构”):
import torchvision
google_net = torchvision.models.inception_v3(pretrained=True)
推荐阅读
- asp.net-core - 处理程序执行后没有出现 Toast 通知
- android - 在 Recyclerview Kotlin 的顶部、中间和底部添加分隔线
- python - 如何在熊猫数据框中返回 n 最大值
- r - 在函数中使用字符列表?
- ruby-on-rails - Rails 嵌套连接 - Rails 4
- python - 处理来自多个驱动器的项目列表
- python - 历史和预测中的 TensorFlow Accuracy 不匹配
- angular - TypeError:无法读取未定义的属性(读取'slideNext')(Ionic 5)
- excel - 自动过滤以排除特定月份
- powershell - 使用 Powershell 列出 AD 中的组和用户数