- anaconda+vs+tensorflow-gpu+cudn+cudnn+python配置
vs2015(首先安装)
cuda9.0
cudnn7.0
tensorflow-gpu1.8.0
python3.6
参考:https://blog.csdn.net/ygjustgo/article/details/78883981
2、could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
2018-10-29 17:01:58.920457: F T:\src\github\tensorflow\tensorflow\core\kernels\conv_ops.cc:713] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms)
解决:
在程序开头加入:
import tensorflow as tf
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '0' #指定第一块GPU可用
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.5 # 程序最多只能占用指定gpu50%的显存
config.gpu_options.allow_growth = True #程序按需申请内存
sess = tf.Session(config = config)