为了账号安全,请及时绑定邮箱和手机立即绑定

运行卷积的时候出错...找不到问题出在哪里...

这是控制台包的错误

Caused by op 'convolutional/Conv2D', defined at:

  File "D:/Python/Mnist_testdemo2/mnist/convolutional.py", line 12, in <module>

    y, variables = model.convolutional(x, keep_prob)

  File "D:\Python\Mnist_testdemo2\mnist\model.py", line 32, in convolutional

    h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)

  File "D:\Python\Mnist_testdemo2\mnist\model.py", line 15, in conv2d

    return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')

  File "D:\Programme\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1112, in conv2d

    data_format=data_format, dilations=dilations, name=name)

  File "D:\Programme\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper

    op_def=op_def)

  File "D:\Programme\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func

    return func(*args, **kwargs)

  File "D:\Programme\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op

    op_def=op_def)

  File "D:\Programme\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1801, in __init__

    self._traceback = tf_stack.extract_stack()


ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[10000,28,28,32] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cpu

[[node convolutional/Conv2D (defined at D:\Python\Mnist_testdemo2\mnist\model.py:15) ]]

Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.


Process finished with exit code 1



代码部分:

1:

File "D:/Python/Mnist_testdemo2/mnist/convolutional.py", line 12, in <module>

    y, variables = model.convolutional(x, keep_prob)

对应代码:

y, variables = model.convolutional(x, keep_prob)

2:
File "D:\Python\Mnist_testdemo2\mnist\model.py", line 32, in convolutional    h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)

对应代码:

h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)

3:

  File "D:\Python\Mnist_testdemo2\mnist\model.py", line 15, in conv2d

    return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')

对应代码:

return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')

希望有人能帮我解答一下...谢谢你们

正在回答

3 回答

如何添加虚拟内存?

0 回复 有任何疑惑可以回复我~

加了个虚拟内存就解决了

1 回复 有任何疑惑可以回复我~

补充一下,最下面显示memoryerror

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

运行卷积的时候出错...找不到问题出在哪里...

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信