I am having problems using the checkpoint_sequential function. Using the documentation, I define my model as
model = nn.Sequential(...)
input_var = checkpoint_sequential(model, chunks, input_var)

But when I start training I get the following error:

“None of the inputs have requires_grad=True. Gradients will be None”

I am guessing what may be happening is that it tries to checkpoint the input, which would not have a gradient. Is this a bug? Do I need to worry about it? Is there a workaround?
There was a discussion about this recently, but with no apparent resolution:

  
    
    
    Checkpoint with no grad requiring inputs PROBLEM autograd
  
  
    May I ask if there is any convenient solution for torch.utils.checkpoint.checkpoint_sequential? Thanks!