作者:qianyu2602915863 | 来源:互联网 | 2023-09-13 08:33
Python版本:3.6.8
Tensorflow-gpu版本:2.0.0
VS版本:2019社区版
CUDA版本:10.0
我使用的版本在上面给出。我已经检查了所有功能的兼容性,但是我不知道为什么它不起作用。
P.S。我也尝试了CUDA 9.0,10.2
代码:
import tensorflow as tf
x1 = tf.constant([1,2,3,4])
x2 = tf.constant([5,6,7,8])
result = tf.multiply(x1,x2)
print(result)
输出:
2019-12-06 19:57:22.786679: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
2019-12-06 19:57:27.682433: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2019-12-06 19:57:27.801889: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce 940MX major: 5 minor: 0 memoryClockRate(GHz): 1.189
pciBusID: 0000:01:00.0
2019-12-06 19:57:27.806669: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked,skip dlopen check.
2019-12-06 19:57:27.812925: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2019-12-06 19:57:27.815874: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-12-06 19:57:27.822247: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce 940MX major: 5 minor: 0 memoryClockRate(GHz): 1.189
pciBusID: 0000:01:00.0
2019-12-06 19:57:27.828920: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked,skip dlopen check.
2019-12-06 19:57:27.837980: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0