andresprados / SPIGA

SPIGA: Shape Preserving Facial Landmarks with Graph Attention Networks.
https://bmvc2022.mpi-inf.mpg.de/155/
BSD 3-Clause "New" or "Revised" License
304 stars 32 forks source link

Importing retinaface causes all torch tensors to lack gradient function #14

Open yhu9 opened 1 year ago

yhu9 commented 1 year ago

Expected behavior of torch Tensors is to have a gradient function if it requires gradient.

Shortest example I have on what is happening for me.

import torch
x = torch.randn(1, requires_grad=True)
print(x + 1)
tensor([1.3468], grad_fn=<AddBackward0>)
import torch
import retinaface
x = torch.randn(1, requires_grad=True)
print(x + 1)
tensor([1.3468])
aixiaodewugege commented 5 months ago

This problem waste a lot of my time.....It took me half a day to fix it.