inception_v3¶
- torchvision.models.inception_v3(*, weights: Optional[Inception_V3_Weights] = None, progress: bool = True, **kwargs: Any) Inception3 [源代码]¶
源自 Rethinking the Inception Architecture for Computer Vision 的 Inception v3 模型架构。
注意
重要提示:与其他模型不同,inception_v3 期望的张量大小为 N x 3 x 299 x 299,因此请确保您的图像尺寸符合要求。
- 参数:
weights (
Inception_V3_Weights
, 可选) – 模型的预训练权重。有关更多详细信息和可能的值,请参阅下面的Inception_V3_Weights
。默认情况下,不使用预训练权重。progress (bool, 可选) – 如果为 True,则在标准错误输出 (stderr) 中显示下载进度条。默认值为 True。
**kwargs – 传递给
torchvision.models.Inception3
基类的参数。有关此类别的更多详细信息,请参阅源代码。
- class torchvision.models.Inception_V3_Weights(value)[源代码]¶
上面的模型构建器接受以下值作为
weights
参数。Inception_V3_Weights.DEFAULT
等同于Inception_V3_Weights.IMAGENET1K_V1
。您也可以使用字符串,例如weights='DEFAULT'
或weights='IMAGENET1K_V1'
。Inception_V3_Weights.IMAGENET1K_V1:
这些权重源自原始论文。也可通过
Inception_V3_Weights.DEFAULT
获取。acc@1 (在 ImageNet-1K 上)
77.294
acc@5 (在 ImageNet-1K 上)
93.45
参数数量
27161264
最小尺寸
高=75,宽=75
类别
丁鱥, 金鱼, 大白鲨, ... (省略 997 个)
训练方法
GFLOPS
5.71
文件大小
103.9 MB
推理变换可通过
Inception_V3_Weights.IMAGENET1K_V1.transforms
获取,并执行以下预处理操作:接受PIL.Image
、批处理的(B, C, H, W)
和单张的(C, H, W)
图像torch.Tensor
对象。使用interpolation=InterpolationMode.BILINEAR
将图像调整为resize_size=[342]
,然后进行中心裁剪,crop_size=[299]
。最后,将值首先重新缩放到[0.0, 1.0]
,然后使用mean=[0.485, 0.456, 0.406]
和std=[0.229, 0.224, 0.225]
进行归一化。