I encountered similar error on Linux machine, but not on Windows machine.
Could you simply comment out line 78: save_rgba(fg_mpi.squeeze(), 'rgba')?
It shouldn’t have much to do with the main issue at hand.
As for your question, in the line trnfs = torch.matmul(src_exts, torch.inverse(tgt_exts)), trnfs and the subsequent psv tensors are the ones in question.
The main issue is that psv tensor becomes zero when it shouldn’t.
One indicator is using the second set of printed max value of psv tensor.
In your output,
max: tensor(1.9490, device='cuda:0')
max: tensor(0.9490, device='cuda:0')

this is the desired value.
When the error appears, it would become something like this.
max: tensor(0., device='cuda:0')
max: tensor(-1., device='cuda:0')