pytorch 学习3(测试训练模型)

数据集准备
使用的是fashionMinst数据集
'''
数据集准备
'''
batch_size = 4 # 分批训练数据、每批数据量
DOWNLOAD_MNIST = False # 是否网上下载数据

#数据准备 都是灰度图像 输入的数据的图像通道数为1
# FashionMNIST,我是保存在data文件夹
if not(os.path.exists('./data/FashionMNIST/')) or not os.listdir('./data/FashionMNIST/'):#判断mnist数据集是否已下载
# not mnist dir or mnist is empyt dir
DOWNLOAD_MNIST = True

train_dataset = datasets.FashionMNIST(
root = './data',
train= True, #download train data
transform = transforms.ToTe

pytorch 学习3(测试训练模型)最先出现在Python成神之路

版权声明:
作者:Zad
链接:https://www.techfm.club/p/21518.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>