当前位置:网站首页>【踩坑合辑】Attempting to deserialize object on CUDA device+buff/cache占用过高+pad_sequence
【踩坑合辑】Attempting to deserialize object on CUDA device+buff/cache占用过高+pad_sequence
2022-07-06 14:50:00 【反科研pua所所长】
Attempting to deserialize object on CUDA device
RuntimeError: Attempting to deserialize object on CUDA device 2 but torch.cuda.device_count() is 1
解决:
device = "cuda:0"
model.load_state_dict(torch.load('tut1-model.pt', map_location=device))
model.cuda(device=device)
buff/cache占用过高
linux上buff/cache占用过高导致卡顿
解决(以root身份执行):
echo 3 > /proc/sys/vm/drop_caches
pad_sequence使用
解决:
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()
边栏推荐
- What are the interface tests? What are the general test points?
- ZABBIX proxy server and ZABBIX SNMP monitoring
- Should novice programmers memorize code?
- 空结构体多大?
- return 关键字
- 2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
- 【sdx62】WCN685X将bdwlan.bin和bdwlan.txt相互转化操作方法
- 小常识:保险中的“保全”是什么?
- General implementation and encapsulation of go diversified timing tasks
- lora同步字设置
猜你喜欢
GPS from getting started to giving up (12), Doppler constant speed
Aardio - 不声明直接传float数值的方法
(18) LCD1602 experiment
2500个常用中文字符 + 130常用中英文字符
Clip +json parsing converts the sound in the video into text
NPDP认证|产品经理如何跨职能/跨团队沟通?
[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation
Management background --5, sub classification
Memorabilia of domestic database in June 2022 - ink Sky Wheel
pytorch_YOLOX剪枝【附代码】
随机推荐
Web APIs DOM 时间对象
Barcodex (ActiveX print control) v5.3.0.80 free version
Attack and defense world miscall
Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
extern关键字
CCNA Cisco network EIGRP protocol
Advantages of link local address in IPv6
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
Seata聚合 AT、TCC、SAGA 、 XA事务模式打造一站式的分布式事务解决方案
Management background --3, modify classification
网络基础入门理解
volatile关键字
China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
0 basic learning C language - digital tube
Learn the principle of database kernel from Oracle log parsing
anaconda安装第三方包
Self made j-flash burning tool -- QT calls jlinkarm DLL mode
将MySQL的表数据纯净方式导出
数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
基于 QEMUv8 搭建 OP-TEE 开发环境