运行卷积运算时出现下面错误:
出现原因:同时打开了PyCharm和VSCode两个编译器,造成了内存占用过多。
解决方法:关掉其中一个编译器,编译即可通过
---------------------------------------------------------------------------
UnknownError Traceback (most recent call last)
in
3 r = tf.reshape(r,[1,5,5,1])
4 wr = tf.reshape(wr,[3,3,1,1])
----> 5 layer = tf.nn.conv2d(r,wr,strides=1,padding='SAME')
6 print(layer)
C:\Python\Python37\lib\site-packages\tensorflow_core\python\ops\nn_ops.py in conv2d_v2(input, filters, strides, padding, data_format, dilations, name)
1912 data_format=data_format,
1913 dilations=dilations,
-> 1914 name=name)
1915
1916
C:\Python\Python37\lib\site-packages\tensorflow_core\python\ops\nn_ops.py in conv2d(input, filter, strides, padding, use_cudnn_on_gpu, data_format, dilations, name, filters)
2009 data_format=data_format,
2010 dilations=dilations,
-> 2011 name=name)
2012
2013
C:\Python\Python37\lib\site-packages\tensorflow_core\python\ops\gen_nn_ops.py in conv2d(input, filter, strides, padding, use_cudnn_on_gpu, explicit_paddings, data_format, dilations, name)
935 pass # Add nodes to the TensorFlow graph.
936 except _core._NotOkStatusException as e:
--> 937 _ops.raise_from_not_ok_status(e, name)
938 # Add nodes to the TensorFlow graph.
939 if not isinstance(strides, (list, tuple)):
C:\Python\Python37\lib\site-packages\tensorflow_core\python\framework\ops.py in raise_from_not_ok_status(e, name)
6604 message = e.message + (" name: " + name if name is not None else "")
6605 # pylint: disable=protected-access
-> 6606 six.raise_from(core._status_to_exception(e.code, message), None)
6607 # pylint: enable=protected-access
6608
C:\Python\Python37\lib\site-packages\six.py in raise_from(value, from_value)
UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [Op:Conv2D]