Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/usr/local/lib/python3.10/dist-packages/torchmetrics/utilities/imports.py) #234

Open
Kiyuma opened this issue Nov 1, 2023 · 0 comments

Comments

@Kiyuma
Copy link

Kiyuma commented Nov 1, 2023

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")

The "_compare_version" => "compare_version"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant