tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is p

tensorflow.python.framework.errors_impl.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]

用tf.keras.layers.Conv2D计算输出:

在这里插入图片描述

1.内存不足:mnist数据集有过,设置动态分配内存即可
而此处不行

2.tensorflow和cudnn或cuda版本不对应:
。。。
在这里插入图片描述
是对应的。

由于是将cudnn另起一个文件夹设置的环境变量。。

后面重新把cudnn通过复制粘贴的方式放到对应的cuda文件夹,可以正常运行了。

解决:
在这里插入图片描述

D:\Anaconda3\envs\tf20\python.exe D:/PycharmProjects/tf20_1st/error.py
2020-01-11 14:05:54.963919: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
2020-01-11 14:05:57.229253: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-01-11 14:05:57.297777: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: 
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.468
pciBusID: 0000:01:00.0
2020-01-11 14:05:57.297914: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-01-11 14:05:57.298323: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-01-11 14:05:57.298598: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-01-11 14:05:57.300111: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: 
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.468
pciBusID: 0000:01:00.0
2020-01-11 14:05:57.300245: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-01-11 14:05:57.300652: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-01-11 14:05:57.927553: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-01-11 14:05:57.927645: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0 
2020-01-11 14:05:57.927696: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N 
2020-01-11 14:05:57.928110: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2996 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
2020-01-11 14:05:58.107859: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-01-11 14:05:59.197239: W tensorflow/stream_executor/cuda/redzone_allocator.cc:312] Internal: Invoking ptxas not supported on Windows
Relying on driver to perform ptx compilation. This message will be only logged once.

进程已结束,退出代码 0

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值