Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

The gradient (Tensor.grad) of decoder weights is None #143

Open
NonvolatileMemory opened this issue Jul 5, 2020 · 1 comment
Open

The gradient (Tensor.grad) of decoder weights is None #143

NonvolatileMemory opened this issue Jul 5, 2020 · 1 comment

Comments

@NonvolatileMemory
Copy link

Hello,
I want to get the gradient w.r.t the parameters in decoder like embedding layer's weights and ffn layer's weights.
However when I run following command the results are always None.

print(model.decoder.layers[0].fc1.weight.grad)

and the following command always return True even the FFN weights:

model.decoder.layers[0].fc1.weight.is_leaf

I don't know where going wrong, thank you

@NonvolatileMemory
Copy link
Author

hook works fine to get the gradient

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant