当前位置:网站首页>pytorch, 指定显卡问题
pytorch, 指定显卡问题
2022-07-22 11:05:00 【迷路在代码中】
在服务器上跑PyTorch的训练代码,原来一直都没有问题。但是重新安装cuda之后,无法指定在哪几块GPU上运行了,只能按照顺序从第0块开始使用。
解决方法:在 os 之后紧随指定显卡。(因为当导入 torch 库后,其已经调用显卡。)
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "4,5,6,7"
import torch
Game Over!
边栏推荐
- Chapter 2: configure data sources, redis, security, swagger and other tools jar for the project
- JS BOM (browser object model)
- Bishett route - hyperspectral image classification with deep learning in pytorch environment
- Wechat applet comprehensive case practice 1
- BUUCTF闯关日记--[NCTF2019]Fake XML cookbook
- Application & rich text editor & file upload
- Pytoch automatic derivation
- [lttng learning journey] ----- components of lttng deconstruction
- 锡盟蒙古族中学校园有线电视光纤传输系统设计剖析
- YOLO9000: Better, Faster, Stronger
猜你喜欢
Buuctf breakthrough diary -- [geek challenge 2019] hardsql1
Learning notes of wechat applet introduction tutorial - operation feedback of UI chapter
Chapter 1: Minio introduction and installation
校园IPTV数字电视教学直播系统在淮安生态文旅区实验小学的应用
(六)vulhub专栏:Apereo-cas 4.x反序列化漏洞
【PyTorch深度学习实践】学习笔记 第四节 反向传播
Juc-6.3-concurrency container queue
Pytoch automatic derivation
Chapter 6: EASYCODE code generator
云报传媒广场数字电视转模拟系统设计分享
随机推荐
BUUCTF闯关日记02--[HCTF 2018]WarmUp1
[LTTng学习之旅]------Trace控制--进阶
BUUCTF闯关日记04--[ACTF2020 新生赛]Include1
JUC-7.0-线程协作-CountDownLatch
ssh时提示“WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED”
4.文本编辑器
BUUCTF闯关日记--[极客大挑战 2019]HardSQL1
中等专业学校校园广播系统解决方案-职业中专校园IP网络广播应用
New cover of time: metauniverse will change everything
Bash variables - numeric operations and operators
[GXYCTF2019]BabyUpload1
BUUCTF闯关日记--[NCTF2019]Fake XML cookbook
On the characteristics of filter pseudo protocol
英语四六级听力有线传输无线发射系统方案
Application & rich text editor & file upload
[lttng learning journey] - trace control -- advanced
Notes d'apprentissage du système intégré
云报传媒广场数字电视转模拟系统设计分享
8.内存与磁盘管理
校园IP网络广播案例-石家庄法商中等专业学校鹿泉校区校园IP广播系统应用