原本是一下子直接放入mnist.test.images, y_: mnist.test.labels,占用内存过大,导致提示'Allocation of 1003520000 exceeds 10% of system memory.'
#  训练结束后报告在测试集上的准确度
print("test accuracy %g" % accuracy.eval(feed_dict={ x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0}))

为了避免内存问题,修改如下:

#参考对训练集的处理方法,可以将一次喂入神经网络的测试数据量减小,从而减小内存分配total_accuracy = 0total_batch_cnt = 0BATCH_SIZE = 50#测试batch占位符test_x_batch = tf.placeholder(tf.float32, [None, 784])test_y_batch = tf.placeholder(tf.float32, [None, 10])for _ in range(int(mnist.test.images.shape[0]/BATCH_SIZE)):test_x_batch, test_y_batch = mnist.test.next_batch(BATCH_SIZE)total_accuracy += accuracy.eval(feed_dict={x: test_x_batch, y_: test_y_batch, keep_prob: 1.0})total_batch_cnt += 1print("test accuracy:%g, cnt:%g total_accuracy:%g" % ((total_accuracy / total_batch_cnt) , total_batch_cnt, total_accuracy))

tensorflow验证模型准确率出现Allocation of 1003520000 exceeds 10% of system memory相关推荐

  1. TensorFlow Allocation of 1511424000 exceeds 10% of system memory

    在利用TensorFlow社区的神经网络新手教程的一个例程时,遇到了一个因为内存问题而导致电脑卡主没反应的问题,本次神经网络的模型为一隐层的神经网络模型(2,3,1结构),在训练过程中,出现了内存的问 ...

  2. Tensorflow: Allocation of XXXXXX exceeds 10% of system memory 可能的原因

    在使用他人的项目代码时,遇到了这个问题 W T:\src\github\tensorflow\tensorflow\core\framework\allocator.cc:108]:Allocatio ...

  3. TensorFlow:Allocation of 256000000 exceeds 10% of system memory对auc的影响

    1.背景: 我在原来特征基础上,增加了一列特征,这列特征是一个list,长度不固定[0,5]之间的一个长度,比如 样本 1: ['找工作', '发工资', '领导力'] 代码中给该列特征先做了一个分桶 ...

  4. Tensorflow Allocation Memory: Allocation of 38535168 exceeds 10% of system memory解决办法

    Tensorflow Allocation Memory: Allocation of 38535168 exceeds 10% of system memory解决办法 在Stackflow上看到的 ...

  5. Allocation of XXXXXXXX exceeds 10% of system memory

    在实验室服务器上跑代码遇到了"Allocation of XXXXXXXX exceeds 10% of system memory"的问题,一个博客中写的是: 这个问题的原因主要 ...

  6. 提示 Allocation of XXXXXXXX exceeds 10% of system memory.怎么办?

    提示 " Allocation of XXXXXXXX exceeds 10% of system memory."怎么办? 问题原因 这个问题的原因主要是两种:一种是你的硬盘容量 ...

  7. TensorFlow2.2.0 Allocation of 614400000 exceeds 10% of system memory

    2VCPU,4G内存,4G Tesla T4显存做基于CNN的CIFAR10例程的时候,在处理数据集的时候,报错如下: 查资料,一种是在import的时候屏蔽报错信息,并没有意义.另一种说是修改bat ...

  8. Allocation of 411041792 exceeds 10% of system memory.

    出现这种警告可以把batch_size改小一点,这样就不会出现警告了: 出现警告: 将batch_size改成16,警告消失

  9. Allocation of 179437568 exceeds 10% of free system memory.

    Allocation of 179437568 exceeds 10% of free system memory. 遇到这个报错是因为电脑性能限制导致. 一.解决方法: 1.把placeholder ...

最新文章

  1. MySQL查询优化:LIMIT 1避免全表扫描
  2. 牛客java面试题总结版(二)
  3. 学军中学推理社2017届招新试题
  4. 有效括号 python_python 有效的括号的实现代码示例
  5. 多重签名(Multisig)
  6. NASA公布“门户计划”,在月球轨道建立空间站进一步探索月球
  7. TensorFlow发布全新版本,又会带来哪些变革?
  8. 演练 模拟银行账户业务
  9. 通过创建一条链来学习区块链 (1)
  10. 昆仑通态复制的程序可以用吗_昆仑通态专题(十二):MCGS嵌入版组态软件的安全管理...
  11. ENVI5.3.1高分2号影像预处理流程
  12. C语言入门基础知识笔记
  13. 魔童降世-暴走的哪吒
  14. MQ学习(二)----ActiveMQ简介(转)
  15. 基础知识——PMIC
  16. 微信突发闪退 BUG,罪魁祸首竟是一张神奇的二维码图片
  17. mysql rpc_启用mysql作用
  18. 阿里云服务器怎么设置密码?怎么停机?怎么重启服务器?
  19. 如何训练出专属的 OpenAI Five ?
  20. 解决win10一开机内存(8G)就占用70%多,查看任务管理器并没有占用内存很高的进程的问题

热门文章

  1. 港科喜讯| 范智勇教授获2022年科学探索奖
  2. 由于管理员设置的策略,该磁盘处于脱机状态解决办法
  3. MySQL服务无法启动伴随部分ERROR解决001
  4. iOS常见的设计模式:工厂设计模式
  5. 电脑运行速度慢的各种原因及解决方法
  6. QT prepare与exec
  7. 计算一年中的第多少天
  8. 使用NDB调试Linux字符设备
  9. Pico neo3 全景视频 从零开始 开发记录
  10. linux(十四)程序和进程的深入研究