-
Notifications
You must be signed in to change notification settings - Fork 71
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 'get_num_classes' from 'torchmetrics.utilities.data' #18
Comments
I think maybe that "Successfully installed monoscene-0.0.0" ,the building process make wrongs? |
This is the error in pytorch-lightning version. Could you verify that your pytorch-lightning version is "pytorch-lightning==1.4.0rc0"? |
yes,I use the "pip install -r requirements.txt" |
Could you try this? |
I tried to reinstall the pytorch-lightning of another version,but it just printed: |
You can set deterministic to False on lines 145 and 159 in the following file |
it works,thanks |
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (C:\ProgramData\anaconda3\Lib\site-packages\torchmetrics\utilities\data.py) |
@Nikithareddy2201 yes! i'm facing the same problem ,Have You Ever solve it ? |
I think the error is because of newer torchmetrics version, could you downgrade it to 0.6.0 with |
there is something wrong with my machine and I reinstall my ubuntu. I re-gitclone the code and just keep the data.but when I follow the readme to do installation,it print:
(monoscene) potato@ubuntu-X299-UD4-Pro:
/workplace/MonoScene$ pip install -e .//workplace/MonoScene$ python monoscene/scripts/train_monoscene.py dataset=kitti enable_log=true kitti_root=$KITTI_ROOT kitti_preprocess_root=$KITTI_PREPROCESS kitti_logdir=$KITTI_LOG n_gpus=1 batch_size=1 sem_scal_loss=FalseObtaining file:///home/potato/workplace/MonoScene
Installing collected packages: monoscene
Running setup.py develop for monoscene
Successfully installed monoscene-0.0.0
(monoscene) potato@ubuntu-X299-UD4-Pro:
Traceback (most recent call last):
File "monoscene/scripts/train_monoscene.py", line 1, in
from monoscene.data.semantic_kitti.kitti_dm import KittiDataModule
File "/home/potato/workplace/MonoScene/monoscene/data/semantic_kitti/kitti_dm.py", line 3, in
import pytorch_lightning as pl
File "/home/potato/anaconda3/envs/monoscene/lib/python3.7/site-packages/pytorch_lightning/init.py", line 20, in
from pytorch_lightning import metrics # noqa: E402
File "/home/potato/anaconda3/envs/monoscene/lib/python3.7/site-packages/pytorch_lightning/metrics/init.py", line 15, in
from pytorch_lightning.metrics.classification import ( # noqa: F401
File "/home/potato/anaconda3/envs/monoscene/lib/python3.7/site-packages/pytorch_lightning/metrics/classification/init.py", line 14, in
from pytorch_lightning.metrics.classification.accuracy import Accuracy # noqa: F401
File "/home/potato/anaconda3/envs/monoscene/lib/python3.7/site-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in
from pytorch_lightning.metrics.utils import deprecated_metrics, void
File "/home/potato/anaconda3/envs/monoscene/lib/python3.7/site-packages/pytorch_lightning/metrics/utils.py", line 22, in
from torchmetrics.utilities.data import get_num_classes as _get_num_classes
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/home/potato/anaconda3/envs/monoscene/lib/python3.7/site-packages/torchmetrics/utilities/data.py)
The text was updated successfully, but these errors were encountered: