当前位置:网站首页>[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))
边栏推荐
- MySQL Gtid_ Executed and gtid_ Purged modification time
- First graphical interface (modified version)
- Redis learning journey sentinel mode
- Redis underlying data structure -- listpack
- 5. interrupts and exceptions
- Tidb source code series: immersive compilation of tidb
- 18 | establish data path (middle): instruction + operation =cpu
- Redis' underlying data structure -- SDS
- 【深度学习】:《PyTorch入门到项目实战》(十二)卷积神经网络:填充(padding)和步幅(stride)
- 比较DFS和BFS的优点和缺点及名称词汇
猜你喜欢
Classification of databases
[deep learning]: introduction to pytorch to project practice (XII) convolutional neural network: padding and stride
平衡二叉树学习笔记------一二熊猫
安装CUDA+CUSP环境,并创建第一个HelloWord入门工程
Redis underlying data structure - underlying principle of hash table
Hashtable source code analysis
Redis learning journey - transaction
25 | 冒险和预测(四):今天下雨了,明天还会下雨么?
Redis learning journey - cache exceptions (CACHE penetration, cache avalanche, cache breakdown)
redis-3. Redis list, set, hash, sorted_ set、skiplist
随机推荐
Database outline
19 | establish data path (bottom): instruction + operation =cpu
Redis learning journey sentinel mode
C language: how to give an alias to a global variable?
AQS - detailed explanation of reentrantlock source code
安装CUDA+CUSP环境,并创建第一个HelloWord入门工程
【Emgu.CV】Emgu.CV.Example\OCR运行报错System.IO.FileNotFoundException:“未能加载文件或程序集“System.Drawing.Common
Deploy RDS service
Recommend several books on DBA promotion
Redis underlying data structure - underlying principle of hash table
Precautions for passing parameters with byte array
Tidb source code series: immersive compilation of tidb
17 | 建立数据通路(上):指令+运算=CPU
Redis' underlying data structure -- SDS
25个国内外文献数据库
18 | 建立数据通路(中):指令+运算=CPU
Questions about ETL: io trino. jdbc. TrinoDriver
Shell script Basics
One article of quantitative framework backtrader read analyzer
Distributed database tidb