TypeError: __init__() got an unexpected keyword argument 'checkpoint_callback'
I had a well-functioning notebook that run all the code perfectly up until this point. I didn’t change anything, but suddenly I got an error when executing the training process:trainer = pl.Trainer(
  logger=logger,
  checkpoint_callback=checkpoint_callback,
  callbacks=[early_stopping_callback],
  max_epochs=N_EPOCHS,
  gpus=1,
  progress_bar_refresh_rate=30
)Error:TypeError                                 Traceback (most recent call last)
<ipython-input-48-3b8eeab1e1d5> in <module>()
      5   max_epochs=N_EPOCHS,
      6   gpus=1,
----> 7   progress_bar_refresh_rate=30
      8 )

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/argparse.py in insert_env_defaults(self, *args, **kwargs)
    343 
    344         # all args were already moved to kwargs
--> 345         return fn(self, **kwargs)
    346 
    347     return cast(_T, insert_env_defaults)

TypeError: __init__() got an unexpected keyword argument 'checkpoint_callback'I can’t figure out what is wrong. Can anyone help me?A link to the notebook with full code:Google Colab
2022-08-12T00:14:56Z
If you’ve restarted and reinstalled pytorch-lightning, it’s possible you’ve updated the library to a newer version.Take a look at pytorch-lightning’sTrainer API. Thecheckpoint_callbackargument is now aclass property:The firstModelCheckpointcallback in the Trainer.callbacks list, orNoneif it doesn’t exist.Try appending thecheckpoint_callbackto the list passed into thecallbacksargument, like so:trainer = pl.Trainer(
  logger=logger,
  callbacks=[early_stopping_callback, checkpoint_callback],
  max_epochs=N_EPOCHS,
  gpus=1,
  progress_bar_refresh_rate=30
)Then, if needed, you can retrieve the callback withcheckpoint_callback = trainer.checkpoint_callback.
2022-08-12T06:22:45Z
I wasn’t aware of the change with the update! Thank you. Your suggestion did fix the issue withcheckpoint_callbackbut a new problem occurred referring to the same line:trainer = pl.Trainer(
  logger=logger,
  callbacks=[early_stopping_callback, checkpoint_callback],
  max_epochs=N_EPOCHS,
  gpus=1,
  progress_bar_refresh_rate=30
)Error:---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-37-05e0ea4feadc> in <module>()
      4   max_epochs=N_EPOCHS,
      5   gpus=1,
----> 6   progress_bar_refresh_rate=30
      7 )

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/argparse.py in insert_env_defaults(self, *args, **kwargs)
    343 
    344         # all args were already moved to kwargs
--> 345         return fn(self, **kwargs)
    346 
    347     return cast(_T, insert_env_defaults)

TypeError: __init__() got an unexpected keyword argument 'progress_bar_refresh_rate'
2022-08-12T14:42:59Z
I realized that I don’t even need theprogress_bar_refresh_rate=30line.
2022-10-07T09:57:30Z
How do remove this though? Isn’t it stored in a pytorch-lightning file that we can’t access from Colab?