我不知道如何解决这个错误,但我希望你们中的一些人知道如何解决这个问题。
错误:TypeError: __init__() got an unexpected keyword argument 'filepath'
完整的错误信息:
File "train.py", line 167, in <module>
main(args)
File "train.py", line 113, in main
checkpoint_callback=checkpoint_callback(),
File "train.py", 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=''
)