import torchvision
import ssl
from torch.utils.tensorboard import SummaryWriter
ssl._create_default_https_context = ssl._create_unverified_context
dataset_transform=torchvision.transforms.ToTensor()
train_set=torchvision.datasets.CIFAR10(root='E:\\postgraduate\\torchexer',train=True,
transform=dataset_transform,download=False)
test_set=torchvision.datasets.CIFAR10(root='E:\\postgraduate\\torchexer',train=False,
transform=dataset_transform,download=False)
#img,target=train_set[0]
#img.show()
#print(train_set[0])
writer=SummaryWriter('logs')
for i in range(10):
img,target=train_set[i]
writer.add_image('1',img,i)
writer.close()
08-14
1531
11-26
1811
02-15
842
08-15
11万+