【发布时间】:2021-01-14 10:30:00
【问题描述】:
当我运行它时,结果显示为“True”。当你看我的输出时
import tensorflow as tf
print(tf.test.is_built_with_cuda())
输出:
C:\Users\vinot\anaconda3\envs\tensorflow\python.exe C:/Users/vinot/PycharmProjects/pythonProject3/Face_Emotion_Recognition.py
2021-01-14 18:16:51.449435: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
True
Process finished with exit code 0
但是当我运行这段代码来检查我的 GPU 是否在这个环境中工作时,它显示“假”
输出:
C:\Users\vinot\anaconda3\envs\tensorflow\python.exe C:/Users/vinot/PycharmProjects/pythonProject3/Face_Emotion_Recognition.py
2021-01-14 19:26:58.943642: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
WARNING:tensorflow:From C:/Users/vinot/PycharmProjects/pythonProject3/Face_Emotion_Recognition.py:41: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2021-01-14 19:27:00.780107: 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-01-14 19:27:00.782485: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library nvcuda.dll
2021-01-14 19:27:00.815146: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 3070 computeCapability: 8.6
coreClock: 1.725GHz coreCount: 46 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 417.29GiB/s
2021-01-14 19:27:00.815337: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
2021-01-14 19:27:00.821246: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll
2021-01-14 19:27:00.821336: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll
2021-01-14 19:27:00.824322: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll
2021-01-14 19:27:00.825471: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll
2021-01-14 19:27:00.826226: 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-01-14 19:27:00.828651: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll
2021-01-14 19:27:00.829411: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudnn64_8.dll
2021-01-14 19:27:00.829487: 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...
False
2021-01-14 19:27:00.935759: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-01-14 19:27:00.935841: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0
2021-01-14 19:27:00.935888: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N
2021-01-14 19:27:00.935940: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
Process finished with exit code 0
【问题讨论】:
标签: python tensorflow gpu