[英]Tensorflow 2 can't find gpu
操作系统:Ubuntu 18.04
CPU:英特尔 i7-8core
GPU:英伟达 GTX 1060
内存:16 GB
我已经使用以下命令在我的 anaconda 虚拟环境中安装了 tensorflow 2 :
pip unistall tensorflow-gpu==2.0
安装没有错误,但是当我使用时:
tf.test.is_gpu_available()
我收到以下消息:
I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-11-16 20:36:36.130788: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz 2019-11-16 20:36:36.131397: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55bd440b6050 executing computations on platform Host. Devices: 2019-11-16 20:36:36.131414: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version 2019-11-16 20:36:36.133350: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1 2019-11-16 20:36:36.134418: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error 2019-11-16 20:36:36.134439: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: quartermaine 2019-11-16 20:36:36.134445: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: quartermaine 2019-11-16 20:36:36.134490: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:200] libcuda reported version is: 430.50.0 2019-11-16 20:36:36.134511: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:204] kernel reported version is: 430.50.0 2019-11-16 20:36:36.134518: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:310] kernel version seems to match DSO: 430.50.0 False
这说明没有 GPU 可用。
首先尝试重新启动系统,因为可能有一些待处理的更新。 其次试试这个: -
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.