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

Installation issues #23

Open
landmann opened this issue Jan 25, 2024 · 2 comments
Open

Installation issues #23

landmann opened this issue Jan 25, 2024 · 2 comments

Comments

@landmann
Copy link

landmann commented Jan 25, 2024

I created a new python virtual environment and installed everything in the requirements.txt. Now I'm getting this issue. Any ideas or pointers? Can't quite find the solution sadly.

Traceback (most recent call last):
  File "/home/ubuntu/notebooks/HandRefiner/handrefiner.py", line 28, in <module>
    from pytorch_lightning import seed_everything
  File "/home/ubuntu/myenv/lib/python3.10/site-packages/pytorch_lightning/__init__.py", line 20, in <module>
    from pytorch_lightning import metrics  # noqa: E402
  File "/home/ubuntu/myenv/lib/python3.10/site-packages/pytorch_lightning/metrics/__init__.py", line 15, in <module>
    from pytorch_lightning.metrics.classification import (  # noqa: F401
  File "/home/ubuntu/myenv/lib/python3.10/site-packages/pytorch_lightning/metrics/classification/__init__.py", line 14, in <module>
    from pytorch_lightning.metrics.classification.accuracy import Accuracy  # noqa: F401
  File "/home/ubuntu/myenv/lib/python3.10/site-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in <module>
    from pytorch_lightning.metrics.utils import deprecated_metrics, void
  File "/home/ubuntu/myenv/lib/python3.10/site-packages/pytorch_lightning/metrics/utils.py", line 22, in <module>
    from torchmetrics.utilities.data import get_num_classes as _get_num_classes
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/home/ubuntu/myenv/lib/python3.10/site-packages/torchmetrics/utilities/data.py)
@wenquanlu
Copy link
Owner

wenquanlu commented Jan 26, 2024

Hi, as mentioned in the link https://www.jianshu.com/p/f5d421458746?v=1705760805683 in this post #19 (comment), you can use pip install pytorch_lightning==1.6.5

@kevincao8828
Copy link

Hi, as mentioned in the link https://www.jianshu.com/p/f5d421458746?v=1705760805683 in this post #19 (comment), you can use pip install pytorch_lightning==1.6.5

Thanks, this saved my day.

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

3 participants