ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/imports.py) #234
I'm using the google notebook
Need to update the Lighting-AI code part, instead of:
[/usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/progress/rich_progress.py](https://localhost:8080/#) in <module>
18 from typing import Any, Dict, Optional, Union
19
---> 20 from torchmetrics.utilities.imports import _compare_version
21
22 import pytorch_lightning as pl
It surpose to be:
from lightning_utilities.core.imports import compare_version
And at the line 26 in usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/progress/rich_progress.py:
_RICH_AVAILABLE: bool = _package_available("rich") and _compare_version("rich", operator.ge, "10.2.2")
I'm using the google notebook Need to update the Lighting-AI code part, instead of:
It surpose to be:
And at the line 26 in usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/progress/rich_progress.py:
The "_compare_version" => "compare_version"