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

find_unused_parameters #153

Open
4 tasks done
ksv87 opened this issue Sep 5, 2024 · 2 comments
Open
4 tasks done

find_unused_parameters #153

ksv87 opened this issue Sep 5, 2024 · 2 comments
Labels
question Further information is requested

Comments

@ksv87
Copy link

ksv87 commented Sep 5, 2024

Before Asking

  • I have read the README carefully. 我已经仔细阅读了README上的操作指引。

  • I want to train my custom dataset, and I have read the tutorials for finetune on your data carefully and organize my dataset correctly; 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。

  • I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。

Search before asking

  • I have searched the DAMO-YOLO issues and found no similar questions.

Question

Warning: find_unused_parameters=True was specified in DDP constructor, b│ PID USER DEV TYPE GPU GPU MEM CPU HOST MEM Command ut did not find any unused parameters in the forward pass. This flag results in an extra trav│ ersal of the autograd graph every iteration, which can adversely affect performance. If your│ model indeed never has any unused parameters in the forward pass, consider turning this

Can we disable find_unused_parameters in detector.py?

def build_ddp_model(model, local_rank):
model = DDP(model,
device_ids=[local_rank],
output_device=local_rank,
broadcast_buffers=False,
find_unused_parameters=True)
return model

Additional

How will this affect the training speed?

@ksv87 ksv87 added the question Further information is requested label Sep 5, 2024
@mbio16
Copy link

mbio16 commented Sep 6, 2024

Hello,

I had to change this method to:

def build_ddp_model(model, local_rank):
    #check if GPU is avaible, otherwise run on CPU
    if torch.cuda.is_available():
        model = DDP(model, device_ids=[local_rank], output_device=local_rank)
    else:
        model = DDP(model)
    return model

fine tune works well.

@ksv87
Copy link
Author

ksv87 commented Sep 11, 2024

thanks @mbio16

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

No branches or pull requests

2 participants