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

虽然显卡很拉跨,但毕竟还算是完美运行
边栏推荐
- 2022-2028 global plant peptone industry research and trend analysis report
- 1009 product of polynomials (25 points) [PTA class A]
- Is it safe to choose mobile phone for stock trading account opening in Hangzhou?
- Explain kubernetes backup and recovery tools velero | learn more about carina series phase III
- 2022-2028 global single travel industry research and trend analysis report
- The programmer's girlfriend gave me a fatigue driving test
- Never use redis expired monitoring to implement scheduled tasks!
- What SQL statements are supported for data filtering
- VR panorama adds contrast function to make the display of differentiation effect more intuitive!
- 深度学习的历史
猜你喜欢

Line number of Jenkins pipeline script execution exception

Development of wireless U-shaped ultrasonic electric toothbrush

优质的水泵 SolidWorks模型素材推荐,不容错过

Combining online and offline, VR panorama is a good way to transform furniture online!

2022-2028 global single travel industry research and trend analysis report

Random ball size, random motion collision

Basic knowledge of Embedded Network - introduction of mqtt

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

ABAQUS 2022 software installation package and installation tutorial

2022-2028 global weight loss ginger tea industry research and trend analysis report
随机推荐
Is it safe to choose mobile phone for stock trading account opening in Hangzhou?
Confirm() method of window
Vmware16 installing win11 virtual machine (the most complete step + stepping on the pit)
IBL预计算的疑问终于解开了
Summer Challenge [FFH] harmonyos mobile phone remote control Dayu development board camera
Introduction to ES6 promise, new features of ES7 and es8 async and await
Thoughts on the future of data analysis in "miscellaneous talk"
Redis - cache penetration, cache breakdown, cache avalanche
How does the VR cloud exhibition hall bring vitality to offline entities? What are the functions?
2022-2028 global carbon fiber room scraper system industry research and trend analysis report
The programmer's girlfriend gave me a fatigue driving test
Simple application example of rhai script engine
Don't worry about whether you can be a coder if you don't learn English well. Learn it first
2022-2028 global single travel industry research and trend analysis report
[DaVinci developer topic] -37- detail IRV: introduction to inter runnable variable + configuration
LVM snapshot: preparation of backup based on LVM snapshot
Techo youth 2022 academic year college open class: behind the live broadcast of Lianmai, explore how to apply audio and video technology
Implementation of OSD on Hisilicon platform (1)
2022-2028 global encrypted external hard disk industry research and trend analysis report
CentOS 6.3 x64 PHP 5.2.6 扩展安装OpenSSL出错的解决方法