Hello, I’m in pytorch-lightning. I’m trying to create a multimodal but i have the same issue in using optimizer. Could you please explain me for this problems
def configure_optimizers(self):
    roberta_params = self.BERT.parameters()
    inception_params = self.incept.parameters()
    dense_params = self.dense.parameters()
    classifier_params = self.cl.parameters()

    # for n,p in classifier_params:
    #   print(n,p)

    grouped_params = [
        {"params": roberta_params, "lr": self.lr_multi},
        {"params": inception_params, "lr": self.lr_multi},
        {"params": dense_params, "lr": self.lr_multi},
        {"params": classifier_params, "lr": self.lr_classifier}
    ]
    optimizer = torch.optim.AdamW(
        grouped_params
    )
    scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1000, gamma=0.98)
  

And here is problem when i start training
/usr/local/lib/python3.7/dist-packages/torch/cuda/amp/grad_scaler.py in step(self, optimizer, *args, **kwargs)
    334             self.unscale_(optimizer)
    335 
--> 336         assert len(optimizer_state["found_inf_per_device"]) > 0, "No inf checks were recorded for this optimizer."
    337 
    338         retval = self._maybe_opt_step(optimizer, optimizer_state, *args, **kwargs)

AssertionError: No inf checks were recorded for this optimizer.

All the code i put in the link below
  
      

      colab.research.google.com
  

  
    

Google Colaboratory



  

  
    
    
  

  


Thanks for your help