Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One import function does not exist. #1

Closed
yexiguafuqihao opened this issue Mar 31, 2021 · 4 comments
Closed

One import function does not exist. #1

yexiguafuqihao opened this issue Mar 31, 2021 · 4 comments

Comments

@yexiguafuqihao
Copy link

from dqrf.ops.functions.ms_deform_attn import SamplingAttention_RA, SamplingEncAttention, SamplingAttention_dec
the function 'SamplingAttention_dec' seems missed in dqrf/ops/functions/ms_deform_attn.py, would you please kindly add this function to the script?

@Hatmm
Copy link
Owner

Hatmm commented Apr 5, 2021

Hi,

You can comment out SamplingAttention_dec, it is the vanilla deformable attention from https://github.com/fundamentalvision/Deformable-DETR

@Hatmm Hatmm closed this as completed Apr 5, 2021
@ljpadam
Copy link

ljpadam commented May 7, 2021

Hi,

After comment out SamplingAttention_dec, the below error occured:

Traceback (most recent call last):
File "train_net.py", line 338, in
args=(args,),
File "/home/jl2/miniconda3/envs/fastreid/lib/python3.7/site-packages/detectron2/engine/launch.py", line 62, in launch
main_func(*args)
File "train_net.py", line 318, in main
trainer = Trainer(cfg)
File "train_net.py", line 61, in init
super().init(cfg)
File "/home/jl2/miniconda3/envs/fastreid/lib/python3.7/site-packages/detectron2/engine/defaults.py", line 310, in init
model = self.build_model(cfg)
File "/home/jl2/miniconda3/envs/fastreid/lib/python3.7/site-packages/detectron2/engine/defaults.py", line 452, in build_model
model = build_model(cfg)
File "/home/jl2/miniconda3/envs/fastreid/lib/python3.7/site-packages/detectron2/modeling/meta_arch/build.py", line 21, in build_model
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
File "/home/jl2/code/PED-DETR-for-Pedestrian-Detection/dqrf/dqrf_detr.py", line 36, in init
self.transformer = build_transformer(cfg) # 11 464 220
File "/home/jl2/code/PED-DETR-for-Pedestrian-Detection/dqrf/transformer.py", line 378, in build_transformer
return Transformer(cfg)
File "/home/jl2/code/PED-DETR-for-Pedestrian-Detection/dqrf/transformer.py", line 55, in init
checkpoint_ffn=checkpoint_dec_ffn, rectified_attention=rectified_attention)
File "/home/jl2/code/PED-DETR-for-Pedestrian-Detection/dqrf/transformer.py", line 317, in init
self.multihead_attn = SamplingAttention_dec(d_model, dec_sampling_points=dec_sampling_points,
NameError: name 'SamplingAttention_dec' is not defined.

Could you kindly provide the commands to train the model on coco dataset?

@yexiguafuqihao
Copy link
Author

And also, we try to repeat this paper, unfortunately, we can't achieve the performance published in the paper with this open-sourced codes.

@Hatmm
Copy link
Owner

Hatmm commented May 26, 2021

Hi,

As I said, you can remove SamplingAttention_dec in the transformer architecture. In configs you can use set RECTIFIED_ATTENTION to true.

Here are some results on COCO dataset for reference:

Model AP
Baseline 46.2
RA 46.4
Baseline with 1000 queries 46.6
Baseline with DQ 46.3

Our DQ module does not work well on COCO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants