当前位置:网站首页>【踩坑合辑】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()
边栏推荐
猜你喜欢

AdaViT——自适应选择计算结构的动态网络

Web APIs DOM 时间对象

手写ABA遇到的坑

2500 common Chinese characters + 130 common Chinese and English characters

HDR image reconstruction from a single exposure using deep CNN reading notes

重磅新闻 | Softing FG-200获得中国3C防爆认证 为客户现场测试提供安全保障

Oracle control file and log file management

0 basic learning C language - digital tube

Installation and use of labelimg

The nearest common ancestor of binary (search) tree ●●
随机推荐
[leetcode daily clock in] 1020 Number of enclaves
pytorch_YOLOX剪枝【附代码】
[线性代数] 1.3 n阶行列式
第4章:再谈类的加载器
Attack and defense world ditf Misc
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
SQL server generates auto increment sequence number
Force deduction question 500, keyboard line, JS implementation
在IPv6中 链路本地地址的优势
OpenCV VideoCapture. Get() parameter details
【sdx62】WCN685X将bdwlan.bin和bdwlan.txt相互转化操作方法
Leetcode question brushing (XI) -- sequential questions brushing 51 to 55
Management background --4, delete classification
Learn the principle of database kernel from Oracle log parsing
Common sense: what is "preservation" in insurance?
2022-07-05 stonedb的子查询处理解析耗时分析
剑指offer刷题记录1
NetXpert XG2帮您解决“布线安装与维护”难题
[sdx62] wcn685x will bdwlan Bin and bdwlan Txt mutual conversion operation method
变量与“零值”的比较