efficient_densenet_pytorch icon indicating copy to clipboard operation
efficient_densenet_pytorch copied to clipboard

How can I apply this to my own model?

Open CXMANDTXW opened this issue 4 years ago • 1 comments

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.

CXMANDTXW avatar Jul 08 '20 12:07 CXMANDTXW

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.

gpleiss avatar Jul 27 '20 14:07 gpleiss