完成模型日志记录模块

This commit is contained in:
2023-11-20 23:53:12 +08:00
parent 3a76ff507f
commit 7e23f6a7b3
8 changed files with 176 additions and 22 deletions

View File

@@ -1,5 +1,13 @@
'''
@作者:你遇了我321640253@qq.com
@文件:VGG16Net.py
@创建时间:2023 11 20
模型网络结构
'''
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchsummary import summary
# 定义 VGG16 网络结构
class VGG16(nn.Module):
@@ -52,3 +60,10 @@ class VGG16(nn.Module):
x = self.fc1(x)
return x
def getSummary(size:tuple):
model = VGG16()
model = model.to(torch.device('cuda' if torch.cuda.is_available() else 'cpu'))
summary(model, size)