Fewshot_Detection icon indicating copy to clipboard operation
Fewshot_Detection copied to clipboard

RuntimeError: shape '[32, 15, 845]' is invalid for input of size 540800

Open Zyt-wenwne opened this issue 3 years ago • 8 comments

Hi, Thanks for your work , but when I run the code , a error happened, ** **Traceback (most recent call last): File "train_meta.py", line 352, in train(epoch) File "train_meta.py", line 197, in train loss,recall_rate,conf_proposal,loss_bbox,loss_conf,loss_cls = region_loss(output, target) File "/home/plc319/anaconda3/envs/ct/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "/home/plc319/桌面/Few-shot-Object-Detection-via-Feature-Reweighting-main/models/layers/region_loss.py", line 296, in forward cls = cls.view(bs, cs, nA * nC * nH * nW).transpose(1, 2).contiguous().view(bs * nA * nC * nH * nW, cs) RuntimeError: shape '[32, 15, 845]' is invalid for input of size 540800 ** can you tell me how to solve the problem **

Zyt-wenwne avatar Apr 28 '21 13:04 Zyt-wenwne

I have the same problem while training base model, and my enviroment is cuda10.1 torch0.3.1 torchvision0.5.0, is there anyone could help us?

whattoshow avatar Apr 29 '21 03:04 whattoshow

Hi, Thanks for your work , but when I run the code , a error happened, ** **Traceback (most recent call last): File "train_meta.py", line 352, in train(epoch) File "train_meta.py", line 197, in train loss,recall_rate,conf_proposal,loss_bbox,loss_conf,loss_cls = region_loss(output, target) File "/home/plc319/anaconda3/envs/ct/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "/home/plc319/桌面/Few-shot-Object-Detection-via-Feature-Reweighting-main/models/layers/region_loss.py", line 296, in forward cls = cls.view(bs, cs, nA * nC * nH * nW).transpose(1, 2).contiguous().view(bs * nA * nC * nH * nW, cs) RuntimeError: shape '[32, 15, 845]' is invalid for input of size 540800 ** can you tell me how to solve the problem **

您好 我遇到了同样的问题 您解决了吗?有偿

ZZY-666 avatar Sep 18 '21 09:09 ZZY-666

I have the same problem while training base model, and my enviroment is cuda10.1 torch0.3.1 torchvision0.5.0, is there anyone could help us?

您好 我遇到了同样的问题 您解决了吗?有偿

ZZY-666 avatar Sep 18 '21 09:09 ZZY-666

@ZZY-666 请问你现在解决了吗

wangzuo-hx avatar Apr 18 '22 03:04 wangzuo-hx

I solve it by change "gpu=0" in the metayolo.data

gusdhg avatar Jul 23 '22 07:07 gusdhg

I have tried to "change GPUs=1,2,3,4" to "GPU=0" in metayolo.data, but it is not solved. Is there any other solution?

hwhwantlearn avatar Nov 09 '22 06:11 hwhwantlearn

@gusdhg @ZZY-666 @whattoshow @zuowanggithub May I know if you have solved the problem? thanks.

hwhwantlearn avatar Nov 09 '22 06:11 hwhwantlearn

应该是base类的内容不对,我改过base类的类别后就对了,改成自己的

Nepenthes-zlc avatar Aug 06 '23 16:08 Nepenthes-zlc