win10上的tensorflowgpu安装问题

2024-06-17 12:43:05 发布

您现在位置:Python中文网/ 问答频道 /正文

当我安装tensorflow gpu 2.2.0时,包括

tf gpu 2.2.0 cuda 10.1 cudnn 7.6.5适用于cuda 10.1 nvidia GTX 1060驱动程序426.00

并满足以下错误回溯

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2020-07-18 17:38:28.372375: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
>>> tf.constant(2)
2020-07-18 17:38:34.134478: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-07-18 17:38:35.100957: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 1060 computeCapability: 6.1
coreClock: 1.6705GHz coreCount: 10 deviceMemorySize: 6.00GiB deviceMemoryBandwidth: 178.99GiB/s
2020-07-18 17:38:35.114601: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-07-18 17:38:35.126682: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-07-18 17:38:35.137879: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-07-18 17:38:35.146739: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-07-18 17:38:35.157400: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-07-18 17:38:35.166308: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-07-18 17:38:35.237584: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-07-18 17:38:35.296525: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0
2020-07-18 17:38:36.129494: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-07-18 17:38:38.755854: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x29083724780 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-07-18 17:38:38.764397: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-07-18 17:38:39.008813: F tensorflow/stream_executor/lib/statusor.cc:34] Attempting to fetch value instead of handling error Internal: failed to get device attribute 13 for device 0: CUDA_ERROR_UNKNOWN: unknown error

Tags: defaultstreamgpudevicetensorflowlibrarydynamicloader
1条回答
网友
1楼 · 发布于 2024-06-17 12:43:05

解决这个问题的最好办法是降级到tensorflow 2.0。 但您也可以尝试以下方法:

创建一个新的conda environment with python 3.x并安装必要的库

为了将来使用,请检查您的python是否添加到path变量中

从此处安装visual studio 2015-2019 x86和x64:https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads(大多数情况下也适用)

请注意代码错误中的这一行: Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

相关问题 更多 >