当前位置:网站首页>Pytorch installs and uses GPU acceleration
Pytorch installs and uses GPU acceleration
2022-07-01 00:40:00 【Peng Xiang】
In the previous study , We came into contact with pytorch, At that time, bloggers considered their own graphics card performance and CUDA Version and other issues , So the installation is cpu Version of , Later, bloggers need to install gpu Version of , Therefore, you can only install it again .
Bloggers are using conda install , Because use pip It doesn't seem to support
Since the blogger has already installed and configured Anoconda, So bloggers only need to create a virtual space and install it 
Activate the virtual environment
conda activate your_env_name( Virtual environment name )

pytorch Installation of each version
https://pytorch.org/get-started/previous-versions/
Bloggers use cuda8, This corresponds to the following installation statement
conda install pytorch==1.0.0 torchvision==0.2.1 cuda80 -c pytorch


Installation successful 
We go back to our pycharm Take a look in the middle :
pytorch Judge gpu Is it available , Test it :
import torch
print('CUDA edition :',torch.version.cuda)
print('Pytorch edition :',torch.__version__)
print(' Whether the graphics card is available :',' You can use ' if(torch.cuda.is_available()) else ' Unavailable ')
print(' Number of graphics cards :',torch.cuda.device_count())
print(' Of the current graphics card CUDA Calculate the force :',torch.cuda.get_device_capability(0))
print(' Current graphics card model :',torch.cuda.get_device_name(0))

Although the graphics card is very stretched , But after all, it still works perfectly
边栏推荐
- C#生成putty格式的ppk文件(支持passphrase)
- 2022就要过去一半了,挣钱好难
- How to edit special effects in VR panorama? How to display detailed functions?
- C # Generate PPK files in Putty format (passthrough support)
- [untitled]
- 2022-2028 global rotary transmission system industry research and trend analysis report
- To tell you the truth, ThreadLocal is really not an advanced thing
- The programmer's girlfriend gave me a fatigue driving test
- Tide - rust web framework based on async STD
- 2022-2028 global retro glass industry research and trend analysis report
猜你喜欢
![[UML] UML class diagram](/img/6f/30bd15967103969e600d69e618d8bf.png)
[UML] UML class diagram

Deployment of mini version message queue based on redis6.0

CentOS installation starts redis

第53章 从业务逻辑实现角度整体性理解程序

2022-2028 global encrypted external hard disk industry research and trend analysis report

Bridge emqx cloud data to AWS IOT through the public network

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

What should I do without 50W bride price

The principle of journal node

20220215-ctf-misc-buuctf-einstein-binwalk analyze picture-dd command separate zip file -- look for password in picture attribute
随机推荐
魔王冷饭||#101 魔王解惑数量多与质量;员工管理;高考志愿填报;游戏架构设计
P4学习——Basic Tunneling
2022-2028 global ultra high purity electrolytic iron powder industry research and trend analysis report
Can SQL execution be written in tidb dashboard
Luogu p1168 median
[designmode] singleton pattern
C WinForm program interface optimization example
Teach you how to use Hal library to get started -- become a lighting master
给按钮的边框和文字设置不同的背景色
The programmer's girlfriend gave me a fatigue driving test
The full technology stack, full scene and full role cloud native series training was launched to help enterprises build a hard core cloud native technology team
leetcode 474. Ones and Zeroes 一和零(中等)
When is it appropriate to replace a virtual machine with a virtual machine?
2022-2028 global herbal diet tea industry research and trend analysis report
The difference between union and union all in MySQL
Bridge emqx cloud data to AWS IOT through the public network
MySQL index test
问题解决:如何管理线程私有(thread_local)的指针变量
How do it outsourcing resident personnel position their pain points?
From January 11, 2007 to January 11, 2022, I have been in SAP Chengdu Research Institute for 15 years