python - TypeError: __init__() got an unexpected keyword argument 'checkpoint_callback'
I'm getting this error message:
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-41-2892cdd4e738&gt; in &lt;module&gt;()
      5   max_epochs=N_EPOCHS,
      6   gpus=1, #GPU
----&gt; 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
--&gt; 345         return fn(self, **kwargs)
    346 
    347     return cast(_T, insert_env_defaults)

TypeError: __init__() got an unexpected keyword argument 'checkpoint_callback'

... when I run this chunk:
trainer = pl.Trainer(
  logger=logger, 
  checkpoint_callback=checkpoint_callback,
  callbacks=[early_stopping_callback],
  max_epochs=N_EPOCHS,
  gpus=1, #GPU
  progress_bar_refresh_rate=30
)

The 'checkpoint_callback' is defined like this:
checkpoint_callback = ModelCheckpoint(
  dirpath=&quot;checkpoints&quot;,
  filename=&quot;best-checkpoint&quot;,
  save_top_k=1,
  verbose=True,
  monitor=&quot;val_loss&quot;,
  mode=&quot;min&quot;
)

I can't figure out what's causing the error - can anyone help me?
View full source code here: https://colab.research.google.com/drive/1hT7PDVb0oGSpLejMGFBMWzRKTPwsSwwS?usp=sharing

As I am looking into pytorch_lightning github, I do not see checkpoint_callback variable in init (https://github.com/Lightning-AI/lightning/blob/master/src/pytorch_lightning/trainer/trainer.py)
Are you sure thats how it's called? What do you want to achieve by passing this checkpoint_callback?
//edit:
I think you just have to append checkpoint_callback to callbacks list
