richzhang / PerceptualSimilarity

LPIPS metric. pip install lpips
https://richzhang.github.io/PerceptualSimilarity
BSD 2-Clause "Simplified" License
3.62k stars 500 forks source link

Using LPIPS with AMP #128

Open SerezD opened 11 months ago

SerezD commented 11 months ago

Hi, thank you for the repo.

I am trying to add the module to my code, but I noticed that the used GPU memory increases a lot, due to the large VGG architecture. The obvious solution is to reduce batch size, but I would like to try with Automatic Mixed Precision (AMP).

The question is: do you have any suggestion or piece of code on how to use the Perceptual Loss module with AMP?

Thank you!