栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Tensorflow Deep MNIST:资源枯竭:分配具有形状的张量时为OOM [10000,32,28,28]

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Tensorflow Deep MNIST:资源枯竭:分配具有形状的张量时为OOM [10000,32,28,28]

这是我解决此问题的方法:错误表示在准确性评估期间GPU内存不足。因此,它需要一个较小的数据集,可以通过批量使用数据来实现。因此,与其在整个测试数据集上运行代码,不如在本文中提到的那样需要分批运行
因此,为了对测试数据集进行准确性评估,而不是以下位置:

print("test accuracy %g"%accuracy.eval(feed_dict={ x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0}))

可以使用:

for i in xrange(10):    testSet = mnist.test.next_batch(50)    print("test accuracy %g"%accuracy.eval(feed_dict={ x: testSet[0], y_: testSet[1], keep_prob: 1.0}))

当我跑

1000 epochs
training
和使用
10 batches
batch_size = 50
accuracyevaluation
,我得到了以下结果:

step 0, training accuracy 0.04step 100, training accuracy 0.88step 200, training accuracy 0.9step 300, training accuracy 0.88step 400, training accuracy 0.94step 500, training accuracy 0.96step 600, training accuracy 0.94step 700, training accuracy 0.96step 800, training accuracy 0.9step 900, training accuracy 1test accuracy 1test accuracy 0.92test accuracy 1test accuracy 1test accuracy 0.94test accuracy 0.96test accuracy 0.92test accuracy 0.96test accuracy 0.92test accuracy 0.94


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/625307.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号