当前位置:网站首页>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))

虽然显卡很拉跨,但毕竟还算是完美运行
边栏推荐
- CTF tool (1) -- archpr -- including installation / use process
- How to specify the number of cycles in JSTL- How to loop over something a specified number of times in JSTL?
- Analysis of 8253a register
- left join左连接匹配数据为NULL时显示指定值
- 2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main()
- Red hat will apply container load server on project atomic
- C WinForm program interface optimization example
- 在指南针上买基金安全吗?
- 2022-2028 global ultra high purity electrolytic iron sheet industry research and trend analysis report
- 2022-2028 global ethylene oxide scrubber industry research and trend analysis report
猜你喜欢

Inventory the six second level capabilities of Huawei cloud gaussdb (for redis)

Implementation of OSD on Hisilicon platform (1)

Random ball size, random motion collision

NE555波形发生器手把手教程之NE555内部结构(一)

20220215-ctf-misc-buuctf-ningen--binwalk analysis --dd command separation --archpr brute force cracking

Vulnerability discovery - App application vulnerability probe type utilization and repair

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

Why should VR panoramic shooting join us? Leverage resources to achieve win-win results

MySQL variables, stored procedures and functions

SAP ui5 beginner tutorial 19 - SAP ui5 data types and complex data binding
随机推荐
Self examination before school starts
Is it safe to open a stock account of Huatai Securities online?
Wordpress blog uses volcano engine veimagex for static resource CDN acceleration (free)
2022-2028 global herbal diet tea industry research and trend analysis report
Kubernetes ---- pod configuration container start command
Thoughts on the future of data analysis in "miscellaneous talk"
2022-2028 global elevator emergency communication system industry research and trend analysis report
Pycharm useful shortcut keys
Design e-commerce seckill system
Analysis of 8253a register
CTF tool (1) -- archpr -- including installation / use process
[PHP] self developed framework qphp, used by qphp framework
Host FL Studio fruit music production daw20.9
Rhai - rust's embedded scripting engine
Line number of Jenkins pipeline script execution exception
Random ball size, random motion collision
Redis - understand the master-slave replication mechanism
Techo youth 2022 academic year college open class: behind the live broadcast of Lianmai, explore how to apply audio and video technology
2022-2028 global mobile scanning radiology room industry survey and trend analysis report
Excuse me, does Flink support synchronizing data to sqlserver