-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Version of densenet #391
Comments
we plan to add a memory efficient version soon via pytorch/pytorch#4594 |
Now that PyTorch 0.4 is officially out, I'm making the efficient_densenet_pytorch code use the checkpointing feature. I can make a PR to this repo once I get it working! |
@gpleiss that would be a nice addition! Maybe by specifying a constructor argument that dispatches to |
@fmassa I'm thinking something like this? # prev_features = [feat_1, feat_2, ...]
# ...
if self.efficient and any(prev_features.requires_grad):
bottleneck_output = checkpoint(bn_function, *prev_features)
else:
bottleneck_output = bn_function(*prev_features)
# ... And the |
That sounds good! |
I'm profiling it now for my repo, and it seems to be good! Should have a PR ready tomorrow. |
So sorry for the late response this... The efficient densenet code seems to work great on a single GPU. However, on multiple GPUs with nn.DataParallel, @wandering007 points out that the checkpointing feature is quite slow (see gpleiss/efficient_densenet_pytorch#36). I think this is because checkpointing requires some sort of inter-GPU synchronization. I'm opening up an issue in PyTorch about this. I'm holding off on a PR for now. |
Sounds good, thanks @gpleiss ! |
May I ask what's the version of densenet in torchivision.models ? The original or efficient_densenet_pytorch, as the original is memory hungry. If it's the original version, would pytorch team consider add the efficient version into model zoo ?
The text was updated successfully, but these errors were encountered: