LYMDLUT / DAB_DETR_mmdetection

Apache License 2.0
0 stars 0 forks source link

unused parameters error #2

Closed JCZ404 closed 2 years ago

JCZ404 commented 2 years ago

Hi~, Sorry to bother you again, when I run your code, I could get the following error sometimes if I turn the find_unused_parameters=False in the DDP follow the other works, and I find that you turn the find_unused_parameters=True to avoid this problem in your code. I would like to ask if this error indicates that there is a problem with the code implementation. Is that the factor that affects the result of the final reproduction?

"RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that
were not used in producing loss. You can enable unused parameter detection by passing the keyword argument find_unused_parameters=True to torch.nn.parallel .DistributedDataParallel, and by
making sure all forward function outputs participate in calculating loss.
If you already have done the above, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module's f orward function. Please include the loss function and the structure of the return value of forward of your module when reporting this issue (e.g. list, dic
t, iterable). "
LYMDLUT commented 2 years ago

check 你的 init() 方法中是否存在参数,在 forward 中没有使用的,注释掉即可。这只是最基础的实现,还有很多工作要做,希望您不要介意,祝好。

LYMDLUT commented 2 years ago

我仔细研究了一下,发现是MLP有一部分没能送入优化器,我会尝试解决一下,请您耐心等待

LYMDLUT commented 2 years ago

Hi~,I have just solved the bug,and it will not influence the result,I will still work on it

JCZ404 commented 2 years ago

Ok, thank you a lot for your patience to solve this problem. Your code is very excellent, which is very helpful for me to learn how to use MMdetection and reproduce DAB-DETR. Thanks again!