当前位置:网站首页>[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()
边栏推荐
- Volatile keyword
- ACL 2022 | 序列标注的小样本NER:融合标签语义的双塔BERT模型
- Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
- 枚举与#define 宏的区别
- OpenNMS分离数据库
- 云原生技术--- 容器知识点
- OpenNMS separation database
- Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medi
- 第十九章 使用工作队列管理器(二)
- 做国外LEAD2022年下半年几点建议
猜你喜欢
MATLAB小技巧(27)灰色预测
That's why you can't understand recursion
LeetCode 练习——剑指 Offer 26. 树的子结构
剑指offer刷题记录1
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
动作捕捉用于蛇运动分析及蛇形机器人开发
2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
config:invalid signature 解决办法和问题排查详解
基于 QEMUv8 搭建 OP-TEE 开发环境
Aardio - 利用customPlus库+plus构造一个多按钮组件
随机推荐
NPDP certification | how do product managers communicate across functions / teams?
QT信号和槽
第十九章 使用工作队列管理器(二)
How do I write Flask's excellent debug log message to a file in production?
BasicVSR_PlusPlus-master测试视频、图片
手写ABA遇到的坑
Comparison between variable and "zero value"
memcached
Const keyword
网络基础入门理解
Senior soft test (Information System Project Manager) high frequency test site: project quality management
Void keyword
关于声子和热输运计算中BORN电荷和non-analytic修正的问题
Financial professionals must read book series 6: equity investment (based on the outline and framework of the CFA exam)
动作捕捉用于蛇运动分析及蛇形机器人开发
return 关键字
Jafka source analysis processor
Sword finger offer question brushing record 1
Should novice programmers memorize code?
poj 1094 Sorting It All Out (拓扑排序)