这两天配置tensorflow实在是搞得精疲力竭,之前一直以为是tensorflow版本的问题,后来在网上查阅相关资料后才知道是这个问题
tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version
出现以上问题的原因在于cuda的驱动版本与cuda的runtime版本不一致,cuda的驱动版本可以通过
nvidia-smi
来查看而驱动对应的cuda版本可以在网上查到,所以在安装tensorflow前,可以先用anaconda安装cuda驱动版本对应的cuda,再装tensorflow,目前实验室的cuda版本应该装9.0
conda install cuda==9.0
在安装好对应的cuda版本后,直接安装tensorflow就会自动安装对应已有cuda版本的tensorflow了