nuclearboy95 / Anomaly-Detection-PatchSVDD-PyTorch

246 stars 56 forks source link

Any hints on why train raises "ValueError: Only one class present in y_true. ROC AUC score is not defined in that case."? #19

Closed lsteffenel closed 2 years ago

lsteffenel commented 2 years ago

Dear all, I'm trying to train PatchSVDD with my own dataset (aerial crop images). I structured the images in the MvTec Ad format, the train folder has 117 "good" images and the test folder has 3 classes (good, road and earth).

However, when I launch the train, I always get a "ValueError: Only one class present in y_true. ROC AUC score is not defined in that case." error right on the first epoch.

I tried both png and jpg file formats, and all images are 640x640 pixels (like in the example below).

If I use one of the MvTec examples (carpet, for example) the train steps perform normally.

Do you have any hints on how to solve this? Thank you very much!

téléchargement (2)

lsteffenel commented 2 years ago

My fault. I didn't understand that I had to provide the ground truth masks as well... I though they were there only for a later evaluation step, not that training uses masks as well. Sorry for the dumb question.