工作日志:3090运行yolopose

pytorch报错RuntimeError: DataLoader worker (pid 18906) is killed by signal: Segmentation fault.

方法1:
num_workers设为0

torch.utils.data.DataLoader(
dataset_test, batch_size=2, shuffle=False, num_workers=0,
collate_fn=utils.collate_fn)

方法2
使用torch1.9,即可解决

conda create -n condapy python=3.7
pip install torch torchvision torchaudio

为此,我重新安装回pytorch==1.9.0 那么我之前修改的东西需要重新改回去。真Cao Dan

AttributeError: ‘Upsample’ object has no attribute ‘recompute_scale_factor’

http://www.manongjc.com/detail/28-llivmebvzwrvnfa.html

降低PyTorch的版本到1.9.0,PyTorch的历史版本Previous PyTorch Versions | PyTorch

或者去掉该参数,参考:
解决方案:

…\torch\nn\modules\upsampling.py #torch文件

修改:

def forward(self, input: Tensor) -> Tensor:
    return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,
                         recompute_scale_factor=self.recompute_scale_factor
                         )

结果:

def forward(self, input: Tensor) -> Tensor:
    return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,
                         #recompute_scale_factor=self.recompute_scale_factor
                         )

CUDA 10.2

conda install pytorch1.9.0 torchvision0.10.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch

CUDA 11.3

conda install pytorch1.9.0 torchvision0.10.0 torchaudio==0.9.0 cudatoolkit=11.3 -c pytorch -c conda-forge

CPU Only

conda install pytorch1.9.0 torchvision0.10.0 torchaudio==0.9.0 cpuonly -c pytorch

方法二:
upsampling.py并打开,修改里面的代码即可解决
https://blog.csdn.net/qq_40280673/article/details/125095353

RuntimeError: result type Float can‘t be cast to the desired output type long int

https://blog.csdn.net/baidu_39629638/article/details/128025583

RuntimeError: CUDA error: unspecified launch failure

CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

ERROR: Unexpected segmentation fault encountered in worker.

AttributeError: module ‘torch’ has no attribute ‘stack’

Epoch gpu_mem box obj cls kpt kptv total labels img_size
10/299 19.7G 0.04496 0.01988 0 0.06022 0.0118 0.1369 147 640: 38%|████████████▉ | 19/50 [00:13<00:22, 1.36it/s]
Traceback (most recent call last):
File “/home/wqt/Projects/yolo5landmark/train.py”, line 552, in
train(hyp, opt, device, tb_writer)
File “/home/wqt/Projects/yolo5landmark/train.py”, line 308, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File “/home/wqt/Projects/yolo5landmark/utils/loss.py”, line 166, in call
tcls, tbox, tkpt, indices, anchors = self.build_targets(p, targets) # targets
File “/home/wqt/Projects/yolo5landmark/utils/loss.py”, line 271, in build_targets
j = torch.stack((torch.ones_like(j), j, k, l, m))


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

烧技湾

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值