HHousen / speaker-change-detection

Speaker change detection using SincNet and an LSTM/Transformer
GNU General Public License v3.0
39 stars 6 forks source link

Problem with auroc classifier constructor #3

Open ahmadalghadban opened 1 year ago

ahmadalghadban commented 1 year ago

I got the following error when running train.py

Traceback (most recent call last):
  File "c:\Users\USER\speaker-change-detection\train.py", line 24, in <module>
    model = SSCDModel(batch_size=BATCH_SIZE, scd=DO_SCD, use_transformer=False)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\USER\speaker-change-detection\model.py", line 94, in __init__
    AUROC(
  File "C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\classification\auroc.py", line 370, in __new__
    raise ValueError(
ValueError: Expected argument `task` to either be `'binary'`, `'multiclass'` or `'multilabel'` but got 293

When clicking on the error line I found the following code:

AUROC(
                    self.num_frames if self.scd else self.num_classes,
                    pos_label=1,
                    average="macro",
                    compute_on_step=False,
                ),

and the AUROC constructor requires 'task' parameter which must be one of ["binary", "multiclass", "multilabel"]