本文介绍了pytorch 把MNIST数据集转换成图片和txt的方法,分享给大家,具体如下:
1.下载Mnist 数据集
import os
# third-party library
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.utils.data as Data
import torchvision
import matplotlib.pyplot as plt
# torch.manual_seed(1) # reproducible
DOWNLOAD_MNIS
1