首页 > 解决方案 > TensorFlow 未使用 GPU 编译

问题描述

我的操作系统是 64 位 Windows 10,我刚刚使用 Anaconda 安装了支持 GPU 的 tensorflow 版本。当我尝试运行它时,出现了一些错误:

>>> import tensorflow as tf
>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
2018-05-21 19:35:51.322771: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2018-05-21 19:35:55.372582: E T:\src\github\tensorflow\tensorflow\stream_executor\cuda\cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_NO_DEVICE
2018-05-21 19:35:55.414069: I T:\src\github\tensorflow\tensorflow\stream_executor\cuda\cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: DESKTOP-IGTS77R
2018-05-21 19:35:55.440073: I T:\src\github\tensorflow\tensorflow\stream_executor\cuda\cuda_diagnostics.cc:165] hostname: DESKTOP-IGTS77R
Device mapping: no known devices.
2018-05-21 19:35:55.454801: I T:\src\github\tensorflow\tensorflow\core\common_runtime\direct_session.cc:284] Device mapping:

如何修复错误?我已经安装了 CUDA9.0 和 CUDNN7.0,我的 python 版本是 3.6。

标签: tensorflow

解决方案


推荐阅读