快捷方式

efficientnet_v2_m

torchvision.models.efficientnet_v2_m(*, weights: Optional[EfficientNet_V2_M_Weights] = None, progress: bool = True, **kwargs: Any) EfficientNet[原始碼]

EfficientNetV2: Smaller Models and Faster Training 構建一個 EfficientNetV2-M 架構。

引數:
  • weights (EfficientNet_V2_M_Weights, optional) – 要使用的預訓練權重。有關更多詳細資訊和可能的取值,請參閱下面的 EfficientNet_V2_M_Weights。預設情況下,不使用預訓練權重。

  • progress (bool, optional) – 如果為 True,則向 stderr 顯示下載進度條。預設值為 True。

  • **kwargs – 傳遞給 torchvision.models.efficientnet.EfficientNet 基類的引數。有關此類的更多詳細資訊,請參閱原始碼

class torchvision.models.EfficientNet_V2_M_Weights(value)[原始碼]

上面的模型構建器接受以下值作為 weights 引數。EfficientNet_V2_M_Weights.DEFAULT 等同於 EfficientNet_V2_M_Weights.IMAGENET1K_V1。您也可以使用字串,例如 weights='DEFAULT'weights='IMAGENET1K_V1'

EfficientNet_V2_M_Weights.IMAGENET1K_V1:

這些權重透過使用 TorchVision 新訓練方法的修改版本,改進了原始論文的結果。也可透過 EfficientNet_V2_M_Weights.DEFAULT 獲取。

acc@1(在 ImageNet-1K 上)

85.112

acc@5(在 ImageNet-1K 上)

97.156

類別

丁鱖魚, 金魚, 大白鯊, ... (省略 997 個)

最小尺寸

height=33, width=33

方法

連結

引數數量

54139356

GFLOPS

24.58

檔案大小

208.0 MB

推理變換可在 EfficientNet_V2_M_Weights.IMAGENET1K_V1.transforms 獲取,並執行以下預處理操作:接受 PIL.Image、批處理 (B, C, H, W) 和單個 (C, H, W) 影像 torch.Tensor 物件。使用 interpolation=InterpolationMode.BILINEAR 將影像大小調整為 resize_size=[480],接著進行中心裁剪 crop_size=[480]。最後,值首先重新縮放至 [0.0, 1.0],然後使用 mean=[0.485, 0.456, 0.406]std=[0.229, 0.224, 0.225] 進行歸一化。

文件

查閱 PyTorch 的完整開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源