IDEA-Research / detrex

detrex is a research platform for DETR-based object detection, segmentation, pose estimation and other visual recognition tasks.
https://detrex.readthedocs.io/en/latest/
Apache License 2.0
1.9k stars 199 forks source link

The H deformable detr code may have some problems ! #332

Open Cao-PeiPei opened 6 months ago

Cao-PeiPei commented 6 months ago

I was able to train with other code, but training with H deformable detr code with the same configuration would cause errors. Can you update it on github? Thankyou!!!!!!!The error is as follows: Traceback (most recent call last): File "detrex/tools/train_net.py", line 307, in launch( File "/root/detrex/detectron2/detectron2/engine/launch.py", line 82, in launch main_func(args) File "detrex/tools/train_net.py", line 302, in main do_train(args, cfg) File "detrex/tools/train_net.py", line 275, in do_train trainer.train(start_iter, cfg.train.max_iter) File "/root/detrex/detectron2/detectron2/engine/train_loop.py", line 149, in train self.run_step() File "detrex/tools/train_net.py", line 101, in run_step loss_dict = self.model(data) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/root/detrex/projects/h_deformable_detr/modeling/h_deformable_detr.py", line 231, in forward ) = self.transformer( File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/root/detrex/projects/h_deformable_detr/modeling/h_deformable_transformer.py", line 462, in forward inter_states, inter_references = self.decoder( File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/root/detrex/projects/h_deformable_detr/modeling/h_deformable_transformer.py", line 211, in forward new_reference_points if self.look_forward_twice else reference_points UnboundLocalError: local variable 'new_reference_points' referenced before assignment

rentainhe commented 6 months ago

Hello, we will check the problem and fix the bug as soon as possible. @Cao-PeiPei

Cao-PeiPei commented 6 months ago

Thankyou!!!!!!!!

Cao-PeiPei commented 5 months ago

@rentainhe Excuse me, I tried it and the above problem still appears, did you change the code? If the code is modified, I'll try again myself and look forward to your reply.