Tensorflow之快速加载MNIST数据集

2022-02-26

from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
def myprint(v):
    print(v)
    print(type(v))

    try:
        print(v.shape)
    except:
        try:
            print(len(v))

图片[1]-Tensorflow之快速加载MNIST数据集-唐朝资源网

except: pass if __name__ == '__main__': mnist = input_data.read_data_sets('./input_data', one_hot=True, validation_size=100) myprint(mnist.train.labels) myprint(mnist.validation.labels) myprint(mnist.test.labels) myprint(mnist.train.images)

图片[2]-Tensorflow之快速加载MNIST数据集-唐朝资源网

myprint(mnist.validation.images) myprint(mnist.test.images)

可能由于网络问题,程序无法将数据集下载到’./’目录,可以手动下载到对应目录:(mnist官网:MNIST的,从这个页面,有一套60,000 个,测试集 10,000 个。)

train–idx3-ubyte.gz:设置(字节)

train–idx1-ubyte.gz:设置(28881字节)

图片[3]-Tensorflow之快速加载MNIST数据集-唐朝资源网

t10k–idx3-ubyte.gz:测试集(字节)

t10k–idx1-ubyte.gz:测试集(4542字节)

MNIST降维可视化参考:

分类:

技术要点:

相关文章:

© 版权声明
THE END
喜欢就支持一下吧
点赞10赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容