当前位置:网站首页>[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()
边栏推荐
- POJ 1258 Agri-Net
- Web APIs DOM time object
- TypeScript获取函数参数类型
- Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
- Aardio - 封装库时批量处理属性与回调函数的方法
- Financial professionals must read book series 6: equity investment (based on the outline and framework of the CFA exam)
- pytorch_YOLOX剪枝【附代码】
- 使用云服务器搭建代理
- ThreadLocal详解
- (十八)LCD1602实验
猜你喜欢

新手程序员该不该背代码?

Aardio - 利用customPlus库+plus构造一个多按钮组件

Aardio - 封装库时批量处理属性与回调函数的方法

Web APIs DOM time object

Financial professionals must read book series 6: equity investment (based on the outline and framework of the CFA exam)

Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)

Clip +json parsing converts the sound in the video into text

Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"

NPDP认证|产品经理如何跨职能/跨团队沟通?

Leetcode exercise - Sword finger offer 26 Substructure of tree
随机推荐
动作捕捉用于蛇运动分析及蛇形机器人开发
Web APIs DOM 时间对象
基于 QEMUv8 搭建 OP-TEE 开发环境
rust知识思维导图xmind
BasicVSR_ Plusplus master test videos and pictures
MySQL教程的天花板,收藏好,慢慢看
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
Is there any requirement for the value after the case keyword?
OpenSSL:适用TLS与SSL协议的全功能工具包,通用加密库
DR-Net: dual-rotation network with feature map enhancement for medical image segmentation
Senior soft test (Information System Project Manager) high frequency test site: project quality management
QT信号和槽
如何用程序确认当前系统的存储模式?
新手程序员该不该背代码?
云原生技术--- 容器知识点
uniapp设置背景图效果demo(整理)
three. JS gorgeous bubble effect
TypeScript获取函数参数类型
Improving Multimodal Accuracy Through Modality Pre-training and Attention
Traversal of a tree in first order, middle order, and then order