Installation issues
landmann opened this issue · 2 comments
landmann commented
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 commented
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 commented
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.