bingykang / Fewshot_Detection

Few-shot Object Detection via Feature Reweighting
https://arxiv.org/abs/1812.01866
528 stars 111 forks source link

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

Open Zyt-wenwne opened 3 years ago

Zyt-wenwne commented 3 years ago

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

whattoshow commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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?

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

wangzuo-hx commented 2 years ago

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

gusdhg commented 2 years ago

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

hwhwantlearn commented 1 year ago

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 commented 1 year ago

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

keys-zlc commented 11 months ago

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