AttributeError: module 'pytorch_lightning.callbacks' has no attribute 'ModelSummary'
时间: 2023-09-20 16:07:28 浏览: 330
用pytorch写的model.py
This error occurs when you try to access the `ModelSummary` attribute of the `pytorch_lightning.callbacks` module, but it doesn't exist.
The `ModelSummary` callback was introduced in PyTorch Lightning version 1.3.0. If you are using an older version of PyTorch Lightning, you won't be able to use this callback.
To fix this error, you need to upgrade your PyTorch Lightning installation to at least version 1.3.0. You can do this using the following command:
```
pip install pytorch-lightning==1.3.0
```
Once you have upgraded to the latest version, you should be able to use the `ModelSummary` callback without any issues.
阅读全文