其他分享
首页 > 其他分享> > win10安装tensorflow2.3.0-gpu

win10安装tensorflow2.3.0-gpu

作者:互联网

首先下载cuda

链接:https://pan.baidu.com/s/1ng9XEKdhO_BuGOucecwYjA
提取码:cvf4

一、安装CUDA

将下载的cuda_10.0.130_411.31_win10.exe 双击

img

(安装时选择自定义安装,若没有安装Visual Studio 需要将Visual Studio插件的勾去掉,如果Display Driver中Current Version要大于New Version则需要吧勾去掉)

img

安装完之后。查看是否安装成功

1、查看nvcc.exe

img

查看cupti64_100.dll

img

3、配置cudnn

把百度云下载的cudnn-10.0-windows10-x64-v7.5.0.56 (1).zip文件进行解压

重命名为cudnn 放到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\ 目录中

img

二、设置环境变量

img

三、安装tensorflow-gpu

img

四、测试

>>> import tensorflow
2020-09-24 21:36:58.690379: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-09-24 21:36:58.695352: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

img

发现引用错误。故到安装目录进行搜索

img

尝试复制一个变成101 试试

img

再次尝试

>>> tf.test.is_gpu_available()
WARNING:tensorflow:From <stdin>:1: 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.
2020-09-24 21:40:33.327771: 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.
2020-09-24 21:40:33.351626: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1ea43e8f260 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-09-24 21:40:33.358441: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-09-24 21:40:33.367019: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2020-09-24 21:40:34.166517: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 950M computeCapability: 5.0
coreClock: 1.124GHz coreCount: 5 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 29.83GiB/s
2020-09-24 21:40:34.175047: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-09-24 21:40:34.184106: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
2020-09-24 21:40:34.200566: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2020-09-24 21:40:34.215799: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2020-09-24 21:40:34.230730: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2020-09-24 21:40:34.245331: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
2020-09-24 21:40:34.269550: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_7.dll
2020-09-24 21:40:34.277842: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] 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...
2020-09-24 21:40:34.863658: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-09-24 21:40:34.871864: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]      0
2020-09-24 21:40:34.879288: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1276] 0:   N
2020-09-24 21:40:34.893831: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1ea44826ef0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-09-24 21:40:34.904479: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): GeForce GTX 950M, Compute Capability 5.0

img

还是出现问题。

还是缺少Dll

链接:https://pan.baidu.com/s/1L_70UMfO75jj1DseXFyF8g
提取码:6brn

下载如上的dll 复制到安装目录中

img

重新进行测试

img

)

重新进行测试

[外链图片转存中…(img-36Eomegc-1622279198325)]

成功引用成功

标签:24,21,cc,09,tensorflow2.3,2020,tensorflow,win10,gpu
来源: https://blog.csdn.net/weixin_43910537/article/details/117388144