- 确定需要安装的pytorch_lightning版本
参考链接:
https://lightning.ai/docs/pytorch/2.1.3/versioning.html#compatibility-matrix
pip install pytorch_lightning==2.1
- 报错:No module named ‘pytorch_lightning.core.lightning’
Replace this line with:from pytorch_lightning.core.module import LightningModule
, because pytorch_lightning 2.0 seems to have replaced the core.lightning with core.module