win10+GTX1050Ti+anaconda3+tensorflow1.14.0+cuda10.0+cudnn7.6.1.34(带GPU使用检测)

news/2024/11/17 3:31:31/

首次安装win10下的GPU深度学习环境

1,首先安装anaconda

下载地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
此处我的版本是:anaconda3-5.0.1(python3.6.3)

2,创建虚拟环境

(之前在直接安装tensorflow中出现了安装失败的问题,然后在虚拟环境中问题解决)

C:\Users\Administrator>conda create -n myenv_python367 python=3.6.7
Fetching package metadata .....................
Solving package specifications: .Package plan for installation in environment D:\Users\Administrator\Anaconda3\envs\myenv_python367:The following NEW packages will be INSTALLED:certifi:        2016.2.28-py36_0       http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freepip:            9.0.1-py36_1           http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freepython:         3.6.7-h9f7ef89_2       http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainsetuptools:     36.4.0-py36_1          http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freesqlite:         3.29.0-he774522_0      http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainvc:             14.1-h0510ff6_4        http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainvs2015_runtime: 14.15.26706-h3a45250_4 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainwheel:          0.29.0-py36_0          http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freewincertstore:   0.2-py36_0             http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freeProceed ([y]/n)? yvs2015_runtime 100% |###############################| Time: 0:00:02   1.01 MB/s
vc-14.1-h0510f 100% |###############################| Time: 0:00:00   0.00  B/s
sqlite-3.29.0- 100% |###############################| Time: 0:00:00   1.13 MB/s
python-3.6.7-h 100% |###############################| Time: 0:00:14   1.46 MB/s
certifi-2016.2 100% |###############################| Time: 0:00:00   3.18 MB/s
wheel-0.29.0-p 100% |###############################| Time: 0:00:00   3.32 MB/s
wincertstore-0 100% |###############################| Time: 0:00:00 483.75 kB/s
setuptools-36. 100% |###############################| Time: 0:00:00   2.88 MB/s
pip-9.0.1-py36 100% |###############################| Time: 0:00:00   2.61 MB/s
#
# To activate this environment, use:
# > activate myenv_python367
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#C:\Users\Administrator>activate myenv_python367

3,安装tensorflow

(1)CPU下的:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade tensorflow

(2)GPU下的:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade tensorflow-gpu

(3) 测试,tensorflow 出现问题:

python
import tensorflow as tf

ImportError: Could not find ‘cudart64_100.dll’. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive

此处解决方案,是找到满足tf1.14对应版本的cuda
解决连接:https://blog.csdn.net/qq_30622831/article/details/81751159

在这里插入图片描述

4,下载安装cuda10

环境下载:链接:https://pan.baidu.com/s/12ge9p3lrH-_PL5octX012g
提取码:w9t6

此处参考连接:https://blog.csdn.net/aaa_aaa1sdf/article/details/80756424?tdsourcetag=s_pcqq_aiomsg

(1)下载在官网:

https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal

在这里插入图片描述
(2)安装:
选择自定义安装:
在这里插入图片描述
如图中所示,去掉VS

在这里插入图片描述
(3)设置路径(根据自己安装路径设置,加入到系统环境路径Path中):

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\ CUPTI\libx64

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib

5,安装cudnn-10.0-windows10-x64-v7.6.1.34

只需要将下载后的文件中的dll,放到对应文件夹下即可
在这里插入图片描述

放入下面文件夹即可:
在这里插入图片描述
在这里插入图片描述

6重启电脑,测试成功

Microsoft Windows [版本 10.0.17134.885]
(c) 2018 Microsoft Corporation。保留所有权利。C:\Users\Administrator>python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> sees=tf.Session()
2019-07-18 14:41:52.946173: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll
2019-07-18 14:41:53.179001: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
2019-07-18 14:41:53.187423: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-07-18 14:41:53.201099: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2019-07-18 14:41:53.206420: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-07-18 14:41:53.219906: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
2019-07-18 14:41:53.229929: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-07-18 14:41:53.246158: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2019-07-18 14:41:54.155172: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-07-18 14:41:54.160876: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187]      0
2019-07-18 14:41:54.163470: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0:   N
2019-07-18 14:41:54.176098: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3001 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
>>> a=tf.constant(10)
>>> b=tf.constant(20)
>>> sess.run(a+b)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'sess' is not defined
>>> sees.run(a+b)
30
>>>

6.1其他调试方法:(这个是在tensorflow1.14虚拟环境下实现的)

参考链接:https://blog.csdn.net/sinat_33486980/article/details/92806775

C:\Users\Administrator>activate tensorflow1.14(tensorflow1.14) C:\Users\Administrator>python
Python 3.6.7 |Anaconda, Inc.| (default, Dec 10 2018, 20:35:02) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import tensorflow
>>> from tensorflow.python.client import device_lib
>>> print(device_lib.list_local_devices())
2019-07-21 09:59:39.657281: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-07-21 09:59:39.661258: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll
2019-07-21 09:59:40.617377: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
2019-07-21 09:59:40.621751: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-07-21 09:59:40.629822: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2019-07-21 09:59:41.207582: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-07-21 09:59:41.210105: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187]      0
2019-07-21 09:59:41.211590: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0:   N
2019-07-21 09:59:41.220506: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/device:GPU:0 with 3001 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 17227910178020249398
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 3146829004
locality {bus_id: 1links {}
}
incarnation: 13565572337421704331
physical_device_desc: "device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1"
]
>>>

http://www.ppmy.cn/news/244120.html

相关文章

国腾|GM8905C(TTL转LVDS)可替代DS90UR905

GM8905C 1. 功能&#xff1a;GM8905C 型 24 位 FPD-LINK II 发送器&#xff0c;主要功能是实现将并行的 24bit 的 RGB 数据以及 3 位控制信号&#xff08;HS/VS/DE&#xff09;转换为 1 路高速差分信号输出。应用图如下&#xff1a; 2. 产品特征 输入&#xff1a;TTL(24bit) 输…

win10+tensorflow-gpu+1050ti(终于安装成功了T﹏T)

前言 可能很多人一开始跟我一样通过查看官网&#xff08;CUDA-GPU支持关系&#xff09;发现1050ti没有对应的CUDA版本&#xff0c;这也是我最开始放弃在自己笔记本上安装TF-gpu版的主要原因。直到疫情原因回不去学校实验室......然后踩坑之路就这样开始了╯﹏╰ 其实写这篇文…

【踩坑教程】win10环境下RTX3050Ti安装Tensorflow-gpu2.5+CUDA11.2.1+cudnn8.1.0

友情提醒&#xff1a;所有蓝字均为超链接 目录 1 本机环境及碎碎念2 排坑指南2.1 TensorFlow及CUDA、cuDNN版本2.2 CUDA版本选择2.2 cuDNN版本选择 3 安装教程3.1 CUDA安装3.2 cuDNN安装3.3 TensorFlow-gpu 2.5安装 参考 1 本机环境及碎碎念 联想拯救者R7000p 2021&#xff0…

win10 GTX1050Ti 安装cuda9.1+cuDNN7+tensorflow_gpu过程

win10 GTX1050Ti 安装cuda9.1cuDNN7tensorflow_gpu过程 1.系统配置2.安装过程一&#xff0c;查看显卡驱动版本&#xff0c;和支持的最高cuda版本二&#xff0c;配置环境变量&#xff0c;nvcc验证三&#xff0c;安装vs&#xff0c;编译工程四&#xff0c;安装cuDNN五&#xff0c…

Tensorflow量化步骤及生成量化的tflite(2)

第二部分&#xff1a;Tensorflow伪量化训练操作&#xff08;生成量化的tflite&#xff09; 序&#xff1a; (2018.12.24更新&#xff1a;鉴于评论中有人误解&#xff0c;我这里写清楚一点&#xff0c;后来者也可以先去看看评论区的问题然后再决定要不要看这篇博客&#xff5e…

TensorFlow GPU版 GTX1650 CUDA10.0 cuDNN10.0 TensorFlow gpu1.15安装成功!

所需软件列表&#xff1a; 最新的显卡驱动 下载地址CUDA Toolkit 下载地址 &#xff08;不要下载最新容易采坑&#xff01;&#xff01;&#xff01;&#xff09;cuDNN 下载地址 &#xff08;版本要与CUDA相对应&#xff09;下载TensorFlow GPU 显卡驱动下载 可以在这里查看自…

Tensorflow-gpu2.0.0安装【显卡型号:GTX1050 TI】

声明&#xff1a;本次组合为【anacond3 tf2.0&#xff08;gpu&#xff09; cuda10.0 cudnn7.6.5 笔记本gtx1050 ti】 第一步:下载并安装anacond3 略&#xff0c;我个人是下载最新版的 附上下载地址: https://www.anaconda.com/products/individual#download-section 第二…

支持LVGL的micropython固件编译(一)

LVGL是一款嵌入式开发比较常用的开源GUI库&#xff0c;lvgl本身采用c以面向对象的方式开发&#xff0c;这种高级特性可以很好的适应高级语言&#xff0c;所以采用python开发也是不错的选择。现在我们就尝试下使用micropython开发lvgl应用。官方对micropython已经做了移植支持&a…