【发布时间】:2020-07-16 08:45:47
【问题描述】:
我以两种方式运行 tf。
首先,我使用python3.5和tf 1.12.0,当我运行tf.Session()时,python3.5的输出是这样的:
2020-07-16 16:40:36.993973: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-07-16 16:40:37.191067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235
pciBusID: 0000:07:00.0
totalMemory: 11.92GiB freeMemory: 11.85GiB
2020-07-16 16:40:37.191124: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2020-07-16 16:40:37.606605: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-07-16 16:40:37.606665: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2020-07-16 16:40:37.606676: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2020-07-16 16:40:37.607545: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 11489 MB memory) -> physical GPU (device: 0, name: Tesla K80, pci bus id: 0000:07:00.0, compute capability: 3.7)
*********************************************************************************************************
然后,我使用带有 tf 1.12.0 的 C_API,以及 libtensorflow.so 和 libtensorflow_frame.soas copy form python3.5 packages. When I runTF_SessionRun()`,输出为:
TF VERSION:1.12.0
2020-07-16 15:49:22.423989: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2020-07-16 15:49:22.631974: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235
pciBusID: 0000:07:00.0
totalMemory: 11.92GiB freeMemory: 11.85GiB
2020-07-16 15:49:22.632046: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1482] Ignoring visible gpu device (device: 0, name: Tesla K80, pci bus id: 0000:07:00.0, compute capability: 3.7) with Cuda compute capability 3.7. The minimum required Cuda capability is 6.0.
2020-07-16 15:49:22.632067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-07-16 15:49:22.632082: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2020-07-16 15:49:22.632095: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
为什么tf-gpu 1.12.0的python3.5可以用k80 gpu,而tf-gpu 1.12.0的c_api不能用k80?
【问题讨论】:
标签: python c++ tensorflow