ucbdrive / hd3

Code for Hierarchical Discrete Distribution Decomposition for Match Density Estimation (CVPR 2019)
BSD 3-Clause "New" or "Revised" License
204 stars 31 forks source link

gpu memory usage #18

Closed amaanda closed 5 years ago

amaanda commented 5 years ago

Hello! I wonder if there is any part in your code where I can set a parameter to use less gpu memory, or if you know of some way to do it using pytorch. I need to do this without losing precision, so resizing the input image is not an opition.

Thanks!

yzcjtr commented 5 years ago

Hi, this is a tricky problem. You can either reduce the batch size or select a more lightweight encoder (e.g. vgg). The latter one should affect the performance. I'm afraid there are no other easy ways for reducing the gpu momery usage with just a few lines of magic codes. Nevertheless, you can turn to the works in model compression for help.

amaanda commented 5 years ago

Yes, I imagine there is no magic trick to get it done easily haha I already reduced batch size to 1 previously and it did reduce the problem, will try changing the encoder then. Thanks for your suggestions!