图像分类
介绍一些backbone
霄逸鸿
日积月累方堆壁垒!
展开
-
2.ResNet18
import torchfrom torch.utils.data import DataLoaderfrom torchvision import datasetsfrom torchvision import transformsfrom torch import nn, optimfrom lenet5 import Lenet5from resnet import ResNet18def main(): batchsz = 128 # 32、64、128 # 注意bat原创 2020-10-26 22:34:29 · 201 阅读 · 0 评论 -
一个完整的图像分类项目
# coding: utf-8import torchfrom torch.utils.data import DataLoaderimport torchvision.transforms as transformsimport numpy as npimport osfrom torch.autograd import Variableimport torch.nn as nnimport torch.nn.functional as Fimport torch.optim as .原创 2021-08-06 15:04:59 · 731 阅读 · 0 评论 -
1.LeNet 和 AlexNet
import torchimport torch.nn as nnimport torchsummary as summaryclass AlexNet(nn.Module): def __init__(self, num_classes=1000): super(AlexNet, self).__init__() self.features = nn.Sequential( nn.Conv2d(3, 64, kernel_size.原创 2021-07-13 14:50:57 · 227 阅读 · 0 评论