当前位置:网站首页>PyTorch安装并使用gpu加速
PyTorch安装并使用gpu加速
2022-07-01 00:32:00 【彭祥.】
之前的学习中,我们接触到了pytorch,当时博主考虑到自己显卡性能和CUDA版本等问题,所以安装的是cpu版本的,后来博主在学习过程中需要安装gpu版本的,因此便只能再次安装。
博主这次使用的是conda安装,因为使用pip好像并不支持
由于博主之前已经安装并配置好了Anoconda,所以博主只需要创建虚拟空间后安装即可
激活虚拟环境
conda activate your_env_name(虚拟环境名称)

pytorch各版本安装
https://pytorch.org/get-started/previous-versions/
博主使用的是cuda8,即对应下面这条安装语句
conda install pytorch==1.0.0 torchvision==0.2.1 cuda80 -c pytorch


安装成功
我们回到我们的pycharm中看一下:
pytorch判断gpu是否可用,测试一下:
import torch
print('CUDA版本:',torch.version.cuda)
print('Pytorch版本:',torch.__version__)
print('显卡是否可用:','可用' if(torch.cuda.is_available()) else '不可用')
print('显卡数量:',torch.cuda.device_count())
print('当前显卡的CUDA算力:',torch.cuda.get_device_capability(0))
print('当前显卡型号:',torch.cuda.get_device_name(0))

虽然显卡很拉跨,但毕竟还算是完美运行
边栏推荐
- 20220215-ctf-misc-buuctf-ningen--binwalk analysis --dd command separation --archpr brute force cracking
- Kubernetes ---- pod configuration container start command
- In depth understanding of jetpack compose kernel: slottable system
- 2022-2028 global ethylene oxide scrubber industry research and trend analysis report
- Wechat official account development (1) introduction to wechat official account
- The difference between union and union all in MySQL
- MySQL index test
- Operation record of reinitialization instance of Dameng database
- 2022-2028 global public address fire alarm system industry research and trend analysis report
- 深度学习的历史
猜你喜欢

left join左连接匹配数据为NULL时显示指定值

2022-2028 global carbon fiber room scraper system industry research and trend analysis report

What should I do without 50W bride price

Host FL Studio fruit music production daw20.9

Gateway service gateway

2022-2028 global ultra high purity electrolytic iron sheet industry research and trend analysis report

Makefile notes (Yiwen Institute makefile)

CentOS install MySQL

To tell you the truth, ThreadLocal is really not an advanced thing

MySQL variables, stored procedures and functions
随机推荐
From January 11, 2007 to January 11, 2022, I have been in SAP Chengdu Research Institute for 15 years
Redis - how to understand publishing and subscribing
How to edit special effects in VR panorama? How to display detailed functions?
When we look at the industrial Internet, we always look at it from the opposite of the consumer Internet
2022-2028 global ICT test probe industry research and trend analysis report
MySQL variables, stored procedures and functions
2022-2028 global mobile scanning radiology room industry survey and trend analysis report
Redis based distributed lock
[designmode] factory pattern
What value should testers play in requirements review? Two minutes will stop you from being stupid
Why did kubernetes win? The changes in the container circle!
CentOS install MySQL
LVM snapshot: backup based on LVM snapshot
C WinForm program interface optimization example
Confirm() method of window
IBL预计算的疑问终于解开了
Tide - rust web framework based on async STD
Plot size and resolution with R markdown, knitr, pandoc, beamer
Summer Challenge [FFH] harmonyos mobile phone remote control Dayu development board camera
2022-2028 global public address fire alarm system industry research and trend analysis report