当前位置:网站首页>[step on pit collection] attempting to deserialize object on CUDA device+buff/cache occupy too much +pad_ sequence
[step on pit collection] attempting to deserialize object on CUDA device+buff/cache occupy too much +pad_ sequence
2022-07-06 22:41:00 【Director of anti scientific research PUA Institute】
Attempting to deserialize object on CUDA device
RuntimeError: Attempting to deserialize object on CUDA device 2 but torch.cuda.device_count() is 1
solve :
device = "cuda:0"
model.load_state_dict(torch.load('tut1-model.pt', map_location=device))
model.cuda(device=device)
buff/cache Occupy too much
linux On buff/cache Too much occupation leads to jamming
solve ( With root execute ):
echo 3 > /proc/sys/vm/drop_caches
pad_sequence Use
solve :
from torch.nn.utils.rnn import pad_sequence
def my_collate(batch):
a = torch.ones(25, 300)
b = torch.ones(22, 300)
c = torch.ones(15, 300)
pad_sequence([a, b, c]).size()
边栏推荐
- View
- pytorch_ Yolox pruning [with code]
- 剑指offer刷题记录1
- On the problems of born charge and non analytical correction in phonon and heat transport calculations
- Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
- The ceiling of MySQL tutorial. Collect it and take your time
- 如何实现文字动画效果
- [IELTS speaking] Anna's oral learning record part1
- void关键字
- Puppeteer连接已有Chrome浏览器
猜你喜欢
config:invalid signature 解决办法和问题排查详解
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
手写ABA遇到的坑
cuda 探索
Pit encountered by handwritten ABA
Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
将MySQL的表数据纯净方式导出
pytorch_YOLOX剪枝【附代码】
rust知识思维导图xmind
Mise en place d'un environnement de développement OP - tee basé sur qemuv8
随机推荐
return 关键字
What are the interface tests? What are the general test points?
Uniapp setting background image effect demo (sorting)
three.js绚烂的气泡效果
View
第十九章 使用工作队列管理器(二)
MySQL----初识MySQL
hdu 5077 NAND(暴力打表)
Mysql database basic operations DML
sizeof关键字
Windows Auzre 微软的云计算产品的后台操作界面
云原生技术--- 容器知识点
HDU 5077 NAND (violent tabulation)
柔性数组到底如何使用呢?
Self made j-flash burning tool -- QT calls jlinkarm DLL mode
case 关键字后面的值有什么要求吗?
Gd32f4xx serial port receive interrupt and idle interrupt configuration
Aardio - does not declare the method of directly passing float values
UDP programming
The ceiling of MySQL tutorial. Collect it and take your time