简体   繁体   English

Tensorflow 2 找不到 gpu

[英]Tensorflow 2 can't find gpu

OS: Ubuntu 18.04操作系统:Ubuntu 18.04

CPU: Intel i7-8core CPU:英特尔 i7-8core

GPU: Nvidia GTX 1060 GPU:英伟达 GTX 1060

RAM: 16 GB内存:16 GB

I have installed tensorflow 2 in my anaconda virtual environment using the following command:我已经使用以下命令在我的 anaconda 虚拟环境中安装了 tensorflow 2 :

pip unistall tensorflow-gpu==2.0 pip unistall tensorflow-gpu==2.0

The installation has no errors but when I use:安装没有错误,但是当我使用时:

tf.test.is_gpu_available() tf.test.is_gpu_available()

I get the following message:我收到以下消息:

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

Which tells that there is no GPU available.这说明没有 GPU 可用。

First try rebooting your system as there might be some pending updates.首先尝试重新启动系统,因为可能有一些待处理的更新。 Secondly try this:-其次试试这个: -

import os
os.environ['CUDA_VISIBLE_DEVICES'] = "0"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM