landskape-ai / triplet-attention

Official PyTorch Implementation for "Rotate to Attend: Convolutional Triplet Attention Module." [WACV 2021]
https://openaccess.thecvf.com/content/WACV2021/html/Misra_Rotate_to_Attend_Convolutional_Triplet_Attention_Module_WACV_2021_paper.html
MIT License
406 stars 49 forks source link

error #21

Closed ZWBdoudou closed 2 years ago

ZWBdoudou commented 2 years ago

line 293, in parsemodel m = nn.Sequential((m(args) for _ in range(n))) if n > 1 else m(*args) # module TypeError: init() takes from 1 to 2 positional arguments but 3 were given

您好,我在yolov5中想加入这个注意力,然后报这个错误,请问该如何修改呢?

digantamisra98 commented 2 years ago

@ZWBdoudou I haven't used YOLOv5 before, can you specify which file you're pointing line 293 to?

ZWBdoudou commented 2 years ago

抱歉现在才回复您,也很感谢您的回复。我把注意力模块添加进了yolov5/models/common.py文件下,相应的yaml文件也修改了,之后运行yolo.py时报错,报错的位置是在yolov5/models/yolo.py文件中的line 293。

digantamisra98 commented 2 years ago

@ZWBdoudou It seems that line 293 in yolov5/models/yolo.py corresponds to the channel numbers required and you might be passing it incorrectly as Triplet is channel preserving and the issue you are facing is not related to Triplet. I recommend you to create an issue on the YOLOv5 repository itself for clarification.