TensorFlow运行报错:tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN303

当我在虚拟机上安装好Keras+tensorflow+theano环境时,以tensorflow作为keras的后端运行会出现如下问题:
TensorFlow运行报错:tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN303_第1张图片
最大的问题是,我安装的是CPU版本,并没有也安装不了支持GPU的CUDA,通过pip3 list命令,我也没看到我安装了GPU版本。
TensorFlow运行报错:tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN303_第2张图片
最后解决方法是,更换成theano后端,输入cat .keras/keras.json,查看当前后端。
TensorFlow运行报错:tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN303_第3张图片
如果安装了theano,那就用gedit .keras/keras.json编辑文件,修改成theano
TensorFlow运行报错:tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN303_第4张图片

你可能感兴趣的:(深度学习,tensorflow,深度学习)