hcw-00 / PatchCore_anomaly_detection

Unofficial implementation of PatchCore anomaly detection
Apache License 2.0
317 stars 95 forks source link

the version of pytorch-lighting and torchmetrics #58

Open Mirage2000i opened 2 months ago

Mirage2000i commented 2 months ago

my env:python=3.6,torch=1.8.1,torchvision=0.9.1,pytorch-lightning=1.3.3,but i found the torchmetrics doesn't work,like this: Traceback (most recent call last): File "train.py", line 17, in import pytorch_lightning as pl File "/home/bread/anaconda3/envs/pl/lib/python3.6/site-packages/pytorch_lightning/init.py", line 20, in from pytorch_lightning import metrics # noqa: E402 File "/home/bread/anaconda3/envs/pl/lib/python3.6/site-packages/pytorch_lightning/metrics/init.py", line 15, in from pytorch_lightning.metrics.classification import ( # noqa: F401 File "/home/bread/anaconda3/envs/pl/lib/python3.6/site-packages/pytorch_lightning/metrics/classification/init.py", line 14, in from pytorch_lightning.metrics.classification.accuracy import Accuracy # noqa: F401 File "/home/bread/anaconda3/envs/pl/lib/python3.6/site-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in from pytorch_lightning.metrics.utils import deprecated_metrics File "/home/bread/anaconda3/envs/pl/lib/python3.6/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' ,then i change the version of torchmetrics to 0.4.1,it work,but the results are very low, DATALOADER:0 TEST RESULTS {'img_auc': 0.6432748538011696, 'pixel_auc': 0.3221238380546673} i don't know why