我以两种方式运行tf
首先,我在tf1.12.0中使用python3.5,当我运行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)
*********************************************************************************************************
然后,我将C_API与tf 1.12.0以及libtensorflow.so
和libtensorflow_框架一起使用。因此as copy form python3.5 packages. When I run
tf_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一起使用
您可以在错误消息中看到,您需要一个计算能力为
6.0
的GPU。您的GPU的计算能力是3.7
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.
作为这个link的解决方案,一个人建议降级到
1.11.0
,这解决了他的问题相关问题 更多 >
编程相关推荐