pytorch
tensorboard --logdir="dataloader"
train_set=torchvision.datasets.CIFAR10(root="./dataset",train=True,transform=dataset_transform,download=True)
dataset_transform=torchvision.transforms.Compose([torchvision.transforms.ToTensor()])
test_loader = DataLoader(dataset=test_data,batch_size=4,shuffle=True,num_workers=0,drop_last=False)#drop_last是否删掉最后一栏
import torch.nn.functional as F
input=torch.reshape(input,(1,1,5,5))
kernel=torch.reshape(kernel,(1,1,3,3))
output=F.conv2d(input,kernel,stride=1)
self.conv1=Conv2d(in_channels=3,out_channels=6,kernel_size=3,stride=1,padding=0)
optimizer = optim.SGD(model.parameters(), lr=0.01, momentum=0.9)
torch.save(vgg16.state_dict(),"vgg16_method2.pth")
dict1=torch.load("vgg16_method2.pth")
vgg16.load_state_dict(dict1)