pytorch进行CIFAR-10分类(5)测试
我的系列博文:
Pytorch打怪路(一)pytorch进行CIFAR-10分类(1)CIFAR-10数据加载和处理
Pytorch打怪路(一)pytorch进行CIFAR-10分类(2)定义卷积神经网络
Pytorch打怪路(一)pytorch进行CIFAR-10分类(3)定义损失函数和优化器
Pytorch打怪路(一)pytorch进行CIFAR-10分类(4)训练
Pytorch打怪路(一)pytorch进行CIFAR-10分类(5)测试(本文)
1.直接上代码
代码第一部分
dataiter = iter(testloader) # 创建一个python迭代器,读入的是我们第一步里面就已经加载好