本地环境记录

深度学习环境搭建

1、查看cuda版本

cat /usr/local/cuda/version.txt

2、查看cudnn版本

 cat /usr/local/cuda/include/cudnn.h | grep CUDNN\_MAJOR \-A 2

3、针对我的暗影精灵本本,训练会出现显存上报的问题

报错信息:

Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

...

Unknown: 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.

解决办法是,在train的py文件里加如下代码,设置显存分配的代码

 import tensorflow as tf  
 import keras  
 ​  
 config = tf.ConfigProto() 
 config.gpu\_options.allow\_growth = True  
 keras.backend.tensorflow\_backend.set\_session(tf.Session(config\=config))

你可能感兴趣的:(tensorflow)