You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Total params: and Params size (MB) of the model printed by summary are different from the bit_base model in timm library. Theoretically, the same settings should be the same. What is the reason?
#329
Open
lucker26 opened this issue
Sep 26, 2024
· 1 comment
model = timm.create_model('vit_base_patch16_224', pretrained=False)
打印模型的摘要信息
summary(model, input_size=( 3, 224, 224))
The text was updated successfully, but these errors were encountered:
lucker26
changed the title
通过summary打印出模型的Total params:和Params size (MB)与timm库中的bit_base模型不一样,理论上相同的设置应该是一样,这是什么原因呢?
The Total params: and Params size (MB) of the model printed by summary are different from the bit_base model in timm library. Theoretically, the same settings should be the same. What is the reason?
Sep 26, 2024
import torch
from vit import ViT
from torchsummary import summary
import timm
v = ViT(
image_size = 224,
patch_size = 16,
num_classes = 1000,
dim = 768,
depth = 12,
heads = 12,
mlp_dim = 3072,
dropout = 0.1,
emb_dropout = 0.1
)
使用 summary 显示模型的摘要
summary(v, input_size=(3, 224, 224), device='cpu') # 传入输入的形状 (C, H, W)
加载 ViT-B/16 模型
model = timm.create_model('vit_base_patch16_224', pretrained=False)
打印模型的摘要信息
summary(model, input_size=( 3, 224, 224))
The text was updated successfully, but these errors were encountered: