Meta-Weight-Net_Code-Optimization icon indicating copy to clipboard operation
Meta-Weight-Net_Code-Optimization copied to clipboard

RuntimeError: One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior.

Open yzakzero opened this issue 3 years ago • 2 comments

Hi, thank you very much for your work. When I use my own dataset and model, It error in this Line: pseudo_grads = torch.autograd. grad(pseudo_loss, pseudo_net.parameters(), create_graph=True)

The following error message is displayed:

RuntimeError: One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior.

Looking forward to your reply.

yzakzero avatar Sep 24 '22 04:09 yzakzero

I meet the same problem, do you deal with it?

machineNo6 avatar Dec 09 '22 08:12 machineNo6

谢谢,收到!

yzakzero avatar Dec 09 '22 08:12 yzakzero