解决TF2.0: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
2020-07-14 06:23
513 查看
3个多小时解决TF2.0: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
在笔记本电脑上搭建的keras深度学习框架中引入卷积层时报错:Failed to get convolution algorithm. This is probably because cuDNN failed to initialize…花了一上午时间,最终解决……
版本信息:
python 3.7.3
CUDA 10.0.130
cuDNN 7.4.2
Tensorflow 2.0.0
Keras 2.3.0
Google+百度发现大家解决该问题有两种方式:
1.CUDA,cuDNN,Tensorflow版本不兼容。主要解决方法是Tensorflow版本太高,需要降版本。(此方法我觉得很麻烦,所以并未尝试)
2.GPU内存不足。需要在代码最前面加几行代码实现对GPU进行按需分配。(然而我尝试了加了各种代码,虽然大同小异,但其他人问题解决了,我的始终没有。)
最终解决办法: 将原有cuDNN 7.4.2版本更换为7.6.5
删掉CUDA bin,include,lib文件夹中原有cuDNN 7.4.2版本拷贝的文件,再将cuDNN 7.6.5版本文件拷贝到相应文件夹中。此时可直接运行Keras和Tensorflow框架中的代码,没有报错。
下面这些全部测试了,都不行。
# 不加这几句,则CONV 报错 # physical_devices = tf.config.experimental.list_physical_devices('GPU') # assert len(physical_devices) > 0, "Not enough GPU hardware devices available" # tf.config.experimental.set_memory_growth(physical_devices[0], True) # from tensorflow.compat.v1 import ConfigProto # from tensorflow.compat.v1 import InteractiveSession # config = ConfigProto() # config.gpu_options.allow_growth = True # session = InteractiveSession(config=config) # from tensorflow.compat.v1 import ConfigProto # from tensorflow.compat.v1 import InteractiveSession # # config = ConfigProto() # config.gpu_options.allow_growth = True # session = InteractiveSession(config=config) # from tensorflow.compat.v1 import ConfigProto # from tensorflow.compat.v1 import InteractiveSession # config = ConfigProto() # config.gpu_options.allow_growth = True # session = InteractiveSession(config=config) # # import tensorflow as tf # config = tf.compat.v1.ConfigProto() # config.gpu_options.allow_growth = True # session = tf.compat.v1.InteractiveSession(config=config) # # import tensorflow as tf # import numpy as np # # config = tf.ConfigProto() # config.gpu_options.per_process_gpu_memory_fraction = 0.3 # sess = tf.Session(config = config)
相关文章推荐
- Failed to get convolution algorithm. This is probably because cuDNN failed to initialize解决办法
- 解决Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- 解决UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initia
- Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to
- tensorflow出现 this is probably because cuDNN failed to initialize, so try looking to see if a……问题
- tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is p
- Failed to get local InetAddress for VMID. This is unlikely to matter.
- quartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak解决
- web项目部署solr问题解决(Server is shutting down or failed to initialize和solr.clustering.ClusteringComponent)
- This application has failed to start because the application configuration is incorrect
- Error: Failed to fetch platform ios Probably this is either a connection problem, or platform speci
- This application failed to start because it could not find or load the Qt platform plugin “windows”错误解决方法
- "Failed to update database "c:\inetpub\wwwroot\WebSite1\App_Data\ASPNETDB.MDF" because the database is read-only."的解决办法
- Anaconda3使用PySide2发生This application failed to start because no Qt platform...的解决方法
- "Failed to update database "c:\inetpub\wwwroot\WebSite1\App_Data\ASPNETDB.MDF" because the database is read-only."的解决办法
- QT:This application has failed to start because the application configuration is incorrect...
- blucesun 解决npm报错:Module build failed: TypeError: this.getResolve is not a function