Closed chenhang98 closed 1 year ago
Hi @tinyalpha, thanks for the bug report. Are you interested to submit a PR? My suggestion is to use
out[wid] = weight_binary_ratio(target.copy(), None if mask is None else mask.copy(), dilate)
Hi @zudi-lin, I have created a PR.
When
valid_mask=None
in VolumeDataset, the following code will throwAttributeError: 'NoneType' object has no attribute 'copy'
.https://github.com/zudi-lin/pytorch_connectomics/blob/fc4dff992702947854ce7c9fd549be1e2cb3711e/connectomics/data/utils/data_weight.py#L23
The following safer codes are suggested.