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

early_stop_callback = EarlyStopping(
    monitor="val_loss", 
    min_delta=0.00, 
    patience=10, 
    verbose=False, 
    mode="min",
)
checkpoint_callback = ModelCheckpoint(save_top_k=1, monitor="val_loss")
trainer = pl.Trainer(
    gpus=1, 
    callbacks=[early_stop_callback, checkpoint_callback],
    max_epochs=500,
    val_check_interval=len(train_dataloader),
)
trainer.fit(segformer_finetuner)

after running…

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-25-07f7faa3f83d> in <cell line: 11>()
      9 checkpoint_callback = ModelCheckpoint(save_top_k=1, monitor="val_loss")
     10 
---> 11 trainer = pl.Trainer(
     12     gpus=1,
     13     callbacks=[early_stop_callback, checkpoint_callback],

/usr/local/lib/python3.9/dist-packages/pytorch_lightning/utilities/argparse.py in insert_env_defaults(self, *args, **kwargs)
     67 
     68         # all args were already moved to kwargs
---> 69         return fn(self, **kwargs)
     70 
     71     return cast(_T, insert_env_defaults)

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

This link is the original file I referred to, and there were no significant changes made to it. Google Colab The program’s environment is on Colab

The Lightning Trainer class doesn’t seem to support the gpus argument as seen in their docs so you might need to update your code and maybe use devices instead.

What suggestions do you have for improvement? Thank you.