triplet_loss_kws
triplet_loss_kws copied to clipboard
Torch autograd expects Variable with requires_grad set to True
Torch autograd expects Variable with requires_grad set to True but doesn't find such Variables. Any idea as to how to get around this?
In pytorch, you need set loss.requres_grad = True. In this project, loss fuction locate in triplet.py:line 50. I solved it through the following steps: mean_losses = losses.mean() mean_losses.requires_grad=True return mean_losses
Please see if uncommenting this line helps, or the @ToughmanL's answer.