'pytorch_lightning' has no attribute 'metrics'
The 'pytorch_lightning.metrics' has been updated to 'torchmetrics' package.
Try changing:
import pytorch_lightning.metrics
to
import torchmetrics
Then replace all 'pytorch_lightning.metrics' with 'torchmetrics' in your code.