Atten4Vis / ConditionalDETR

This repository is an official implementation of the ICCV 2021 paper "Conditional DETR for Fast Training Convergence". (https://arxiv.org/abs/2108.06152)
Apache License 2.0
358 stars 48 forks source link

Hello, may I ask how to visualize the spatial attention diagram in the paper? Where is the corresponding code? #20

Closed wulele2 closed 2 years ago

wulele2 commented 2 years ago

I have successfully visualized, thank you for your great work。

SaifeiYan commented 2 years ago

could you send the visualized file to me ,thanks!

SaifeiYan commented 2 years ago

I have successfully visualized, thank you for your great work。

wulele2 commented 2 years ago

https://github.com/wulele2/Detr-heat-map-visualization

SaifeiYan commented 2 years ago

https://github.com/wulele2/Detr-heat-map-visualization Hi, I ran the code you posted and got the following error, how do I fix it? Thanks a lot! Traceback (most recent call last): File "test.py", line 117, in model.transformer.decoder.layers[-1].multihead_attn.register_forward_hook( File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 948, in getattr type(self).name, name)) AttributeError: 'TransformerDecoderLayer' object has no attribute 'multihead_attn'

wulele2 commented 2 years ago

我运行没问题,可能是pytorch版本问题,我的是1.7.1