微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

tensorflow 未检测到 GPU 并且无法完成 hello = tf.constant('hello')

如何解决tensorflow 未检测到 GPU 并且无法完成 hello = tf.constant('hello')

我在用

CUDA 11.1

张量流 2.4.1

蟒蛇 3.6.12

numpy 1.16.4

无法完成 hello = tf.constant('hello') 错误发生

2021-03-07 21:21:56.799062: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices,tf_xla_enable_xla_devices not set
2021-03-07 21:21:56.800126: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library nvcuda.dll
2021-03-07 21:21:57.353810: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 1050 computeCapability: 6.1
coreClock: 1.493GHz coreCount: 5 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 104.43GiB/s
2021-03-07 21:21:57.353998: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
2021-03-07 21:21:57.364724: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll
2021-03-07 21:21:57.364898: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll
2021-03-07 21:21:57.370873: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll
2021-03-07 21:21:57.372735: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll
2021-03-07 21:21:57.377804: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2021-03-07 21:21:57.382008: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll
2021-03-07 21:21:57.382892: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2021-03-07 21:21:57.384941: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1757] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-03-07 21:21:57.393327: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (onednN) to use the following cpu instructions in performance-critical operations:  AVX2
To enable them in other operations,rebuild TensorFlow with the appropriate compiler flags.
2021-03-07 21:21:57.393735: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-03-07 21:21:57.393849: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267]
2021-03-07 21:21:57.394400: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices,tf_xla_enable_xla_devices not set

enter image description here

并且在检查时,发现 tensorflow 没有检测到 GPU

import tensorflow as tf
print("Num GPUs Available: ",len(tf.config.experimental.list_physical_devices('GPU')))

Num GPUs Available:  0

如何解决这种情况?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。