摘要:
实现代码如下: import torch.functional as F class LeNet(torch.nn.Module): def __init__(self): super(LeNet, self).__init__() # 1 input image channel (black & 阅读全文
摘要:
保存模型: torch.save(model, 'model.pth') 加载模型: model = torch.load('model.pth') 阅读全文
摘要:
自定义数据集的代码如下: import os import pandas as pd from torchvision.io import read_image class CustomImageDataset(Dataset): def __init__(self, annotations_fil 阅读全文