sail-sg / volo

VOLO: Vision Outlooker for Visual Recognition
Apache License 2.0
922 stars 94 forks source link

TypeError: forward() takes 1 positional argument but 2 were given #22

Closed YHDASHEN closed 3 years ago

YHDASHEN commented 3 years ago

Hi,

when I used volo_d1 pretrained model for my training. I loaded this model successfully. But I received this error when I do the training step. Could you please give me some hint? Here is the input before forward() function I traced. The original one is resnet18, it worked fine. d1_224.txt resnet18.txt

Thank you in advance.

Best regards, Hui Yu

yuanli2333 commented 3 years ago

The output of volo includes https://github.com/sail-sg/volo/blob/1f67923404d85cb8012a61b35d7eff782fe90cef/models/volo.py#L643-L645 So for normal training, you only need x_cls and can use x[0] to ignore the other output, you may want to refer to this issue.

YHDASHEN commented 3 years ago

Could you please send me the structure of VOLO model?