mahmoudnafifi / HistoGAN

Reference code for the paper HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms (CVPR 2021).
MIT License
267 stars 27 forks source link

RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn #33

Closed floppycracken closed 10 months ago

floppycracken commented 10 months ago

Thank you for this amazing work. I was trying to integrate the histogram loss into my own network, I copied the class as it is from the Colab notebook but I get the below error: RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

Do you have any idea how can I sort this out. Thank You

floppycracken commented 10 months ago

Sorry, the problem was from my side only. Nothing to do with your code.