赞
踩
查找 ‘./data/images’ 文件夹下所有 png格式图片。
import os
data_dir = './data/images'
filename = [name for name in os.listdir(data_dir) if os.path.splitext(name)[-1] == '.png']
import torch
import torch.nn as nn
first_model = nn.Sequential(
nn.Linear(3072, 512),
nn.Tanh(),
nn.Linear(512, 2),
nn.LogSoftmax(dim=1))
sum([p.numel() for p in first_model.parameters()])
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。