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

How can I apply this to my own model? #70

Open
CXMANDTXW opened this issue Jul 8, 2020 · 1 comment
Open

How can I apply this to my own model? #70

CXMANDTXW opened this issue Jul 8, 2020 · 1 comment

Comments

@CXMANDTXW
Copy link

CXMANDTXW commented Jul 8, 2020

Thank you for your nice work.
My model use the densenet connections like:

tensorFeat = torch.cat([self.moduleOne(tensorFeat), tensorFeat], 1)
tensorFeat = torch.cat([self.moduleTwo(tensorFeat), tensorFeat], 1)
tensorFeat = torch.cat([self.moduleThr(tensorFeat), tensorFeat], 1)
tensorFeat = torch.cat([self.moduleFou(tensorFeat), tensorFeat], 1)
tensorFeat = torch.cat([self.moduleFiv(tensorFeat), tensorFeat], 1)

What do I need to do to implement efficient technology to save this part of memory consumption.Densenet connections is just a part of my full model.

@gpleiss
Copy link
Owner

gpleiss commented Jul 27, 2020

It really depends on the other aspects of your model. This implementation uses torch's gradient checkpointing feature: https://github.com/gpleiss/efficient_densenet_pytorch/blob/master/models/densenet.py#L38 - which trades off time for memory efficiency.

See these docs for more information.

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

2 participants