当前位置:网站首页>[pytorch] pytorch0.4.0 installation tutorial and GPU configuration collection (including test code)
[pytorch] pytorch0.4.0 installation tutorial and GPU configuration collection (including test code)
2022-06-13 07:43:00 【neu_ eddata_ yjzhang】
windows Installation under system pytorch0.4.0, stay linux When installing under the system, you only need to set the... In the command "win_amd64" Switch to ''linux_x86_64'' that will do .( Mostly , It depends on your system , But the method is the same )
Python3.6+pip install cpu edition
pip install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp36-cp36m-win_amd64.whl
Python3.6+pip install gpu edition
at present gpu Versioning support cuda8.0,cuda9.0 and cuda9.1, Please select the corresponding version to download and install , Do not execute the following three commands at the same time
pip install http://download.pytorch.org/whl/cu80/torch-0.4.0-cp36-cp36m-win_amd64.whl
pip install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp36-cp36m-win_amd64.whl
pip install http://download.pytorch.org/whl/cu91/torch-0.4.0-cp36-cp36m-win_amd64.whl
1. see pytorch Whether it exists and pytorch Version of
import torch
print(torch.__version__)
2. see cuda Is it available
print(torch.cuda.is_available())3. see cuda edition
print(torch.version.cuda)
4. View current working GPU
print(torch.cuda.current_device())
5. see gpu Number of
print(torch.cuda.device_count())

6. Set up work GPU
print(torch.cuda.current_device())
torch.cuda.set_device(1)
print(torch.cuda.current_device())
Some methods say that the following methods can also realize switching GPU But this sentence needs to be written in "import torch" Before .
os.environ["CUDA_VISIBLE_DEVICES"] = '0'

7. see gpu name , Device index defaults from 0 Start :
print(torch.cuda.get_device_name(0))
print(torch.cuda.get_device_name(1))
边栏推荐
- Redis learning journey --redis Conf details
- Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object
- 9. process control
- 量化框架backtrader之一文讀懂Analyzer分析器
- v-for生成的子组件列表删除第n行出现数据错乱问题
- 17 | establish data path (upper): instruction + operation =cpu
- MySQL summary
- P6154 游走(记忆化搜索
- 11.29 Li Kou swipes questions every day
- A small soft raster engine with clear thinking and a case of quaternion combination
猜你喜欢

GCC compilation process, function library related compilation process

22 | 冒险和预测(一):hazard是“危”也是“机”

Redis' underlying data structure -- SDS

Oracle problem: the data in the field is separated by commas. Take the data on both sides of the comma

量化框架backtrader之一文读懂Analyzer分析器

MySQL summary

Redis learning journey - cache exceptions (CACHE penetration, cache avalanche, cache breakdown)

A troubleshooting process for database timeout caused by SQL misguided

25 | 冒险和预测(四):今天下雨了,明天还会下雨么?

redis-2. Redis string type & bitmap
随机推荐
DATE_ SUB()
EF CORE执行SQL语句
uniapp 小程序根据权限动态生成 tabbar
Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object
Redis master-slave replication - underlying principle
Find the first and last positions of elements in a sorted array
MySQL summary
[redis problem] record a big key problem handling
Consistency under distributed
First graphical interface
Redis learning journey - cache exceptions (CACHE penetration, cache avalanche, cache breakdown)
Redis master-slave replication - the underlying principle of partial resynchronization
Distributed database tidb
21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
Redis cluster parsing docker building redis cluster
Considerations for using redis transactions
[MySQL] rapid data deletion recovery tool - binlog2sql
Shell script Basics
Tidb certification guide PCTA Pctp
EF core execute SQL statement