Hi,
If you expect that some of the parameters in the model are not used, then you can pass allow_unused=True as suggested in the error message.
Otherwise you want to make sure that you only do differentiable ops with Tensors that can require gradients. In particular, only floating point Tensors can require gradients