TypeError: __init__() got an unexpected keyword argument 'filepath'
I don't know how to solve this error but I hope some of you guys know how to solve this issue.
Error:TypeError: __init__() got an unexpected keyword argument 'filepath'
Full error message:
  File &quot;train.py&quot;, line 167, in &lt;module&gt;
    main(args)
  File &quot;train.py&quot;, line 113, in main
    checkpoint_callback=checkpoint_callback(),
  File &quot;train.py&quot;, line 86, in checkpoint_callback
    return ModelCheckpoint(
TypeError: __init__() got an unexpected keyword argument 'filepath'

from pytorch_lightning.callbacks import ModelCheckpoint

save_model_path = path/to/your/dir
def checkpoint_callback():
    return ModelCheckpoint(
        filepath= save_model_path,
        save_top_k=True,
        verbose=True,
        monitor='val_loss',
        mode='min',
        prefix=''
    )


ModelCheckpoint doesn't have a filepath keyword, it does however have a dirpath keyword (as you can see in the documentation), replace filepath with dirpath, like this:
from pytorch_lightning.callbacks import ModelCheckpoint

save_model_path = path/to/your/dir
def checkpoint_callback():
    return ModelCheckpoint(
        dirpath=save_model_path, # changed line
        save_top_k=True,
        verbose=True,
        monitor='val_loss',
        mode='min',
        prefix=''
    )

