我正在训练一个多标签文本分类,我正在使用PyTorch Lightning来训练模型。
下面是代码:
checkpoint_callback = ModelCheckpoint(
dirpath="checkpoints",
filename="best-checkpoint",
save_top_k=1,
verbose=True,
monitor="val_loss",
mode="min"
)```
And i'm getting
---------------------------------------------------------------------------
`TypeError Traceback (most recent call last)
\<ipython-input-73-9e7c38808397\> in \<cell line: 1\>()
\----\> 1 checkpoint_callback = ModelCheckpoint(
2 dirpath="checkpoints",
3 filename="best-checkpoint",
4 save_top_k=1,
5 verbose=True,
TypeError: __init__() missing 1 required positional argument: 'filepath'`
`how to fix it?`
1条答案
按热度按时间vq8itlhq1#
很奇怪,也许你安装错误的pytorch lightning .我试过这个在colab和没有错误:
检查是否正确导入。