查看swintransformer的网络结构
import torch
#导入对应的模型
from model import swin_tiny_patch4_window7_224 as create_model
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = create_model(num_classes=5).to(device)#实际上有没有.to(device)输出的model都一样
print(model)
输出结构
SwinTransformer(
(patch_embed): PatchEmbed(
(proj): Conv2d(3, 96, kernel_size=(4, 4), stride=(4, 4))
(norm): LayerNorm((96,), eps=1e-05, elementwise
共有 0 条评论