After updating from torchmetrics 0.10.0
to 1.3.1
I get the following error when initializing a confusion matrix:
File "/Users/user/Documents/ai-models/src/metrics/classifier.py", line 85, in __init__
self.confusion_matrix_metrics = nn.ModuleDict({
File "/Users/user/Documents/ai-models/src/metrics/classifier.py", line 86, in <dictcomp>
dataset_split: nn.ModuleDict({
File "/Users/user/Documents/ai-models/src/metrics/classifier.py", line 87, in <dictcomp>
attribute.name: torchmetrics.ConfusionMatrix(
File "/Users/user/Documents/ai-models/venv/lib/python3.8/site-packages/torchmetrics/classification/confusion_matrix.py", line 526, in __new__
return MulticlassConfusionMatrix(num_classes, **kwargs)
File "/Users/user/Documents/ai-models/venv/lib/python3.8/site-packages/torchmetrics/classification/confusion_matrix.py", line 265, in __init__
super().__init__(**kwargs)
File "/Users/user/Documents/ai-models/venv/lib/python3.8/site-packages/torchmetrics/metric.py", line 147, in __init__
raise ValueError(f"Unexpected keyword arguments: {', '.join(kwargs_)}")
ValueError: Unexpected keyword arguments: `nan_strategy`
I initialized the confusion matrix in the following way:
torchmetrics.ConfusionMatrix(
task='multiclass',
num_classes=10,
ignore_index=-1,
normalize='true',
nan_strategy='ignore'
)
Is the attribute nan_strategy
deprecated or was I simply passing a useless argument before?