You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a MetricCollection with MatthewsCorrCoef as part of the list, the use of .clone method raises an error.
This happens only in 0.10.0. The same code in 0.9.3 will work.
To Reproduce
Install torchmetrics 0.10.0
Use code sample below
This will lead to the following issue when .clone tries to deepcopy:
>>> metrics.clone(prefix='train')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "./anaconda3/envs/pytorch/lib/python3.8/site-packages/torchmetrics/collections.py", line 300, in clone
mc = deepcopy(self)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 296, in _reconstruct
value = deepcopy(value, memo)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "./anaconda3/envs/pytorch/lib/python3.8/copy.py", line 264, in _reconstruct
y = func(*args)
File "./anaconda3/envs/pytorch/lib/python3.8/copyreg.py", line 91, in __newobj__
return cls.__new__(cls, *args)
TypeError: __new__() missing 1 required positional argument: 'num_classes'
🐛 Bug
When building a MetricCollection with MatthewsCorrCoef as part of the list, the use of .clone method raises an error.
This happens only in 0.10.0. The same code in 0.9.3 will work.
To Reproduce
This will lead to the following issue when .clone tries to deepcopy:
Code sample
Expected behavior
Clone doesn't crash :)
Environment
pip install torchmetrics==0.10.0
The text was updated successfully, but these errors were encountered: