DDANet icon indicating copy to clipboard operation
DDANet copied to clipboard

RuntimeError: Boolean value of Tensor with more than one value is ambiguous

Open tphankr opened this issue 4 years ago • 4 comments

When I type python train.py, I faced the error, as following: RuntimeError: Boolean value of Tensor with more than one value is ambiguous. image

My folders is order, as following: image in the new_data: image

I aslo google but I can't solve it. Please help me. thank you @nikhilroxtomar.

tphankr avatar Jul 22 '21 19:07 tphankr

I think you should check the data type of the m_pred and m variables. Do they match the required data type required by the loss function?

nikhilroxtomar avatar Jul 23 '21 05:07 nikhilroxtomar

Thank you @nikhilroxtomar. I am gona to check it.

Thank you @nikhilroxtomar

tphankr avatar Jul 23 '21 16:07 tphankr

改为 nn.BCEWithLogitsLoss()(m_pred, m)

auger1 avatar Nov 09 '22 03:11 auger1

Thank you very much @auger1 and @nikhilroxtomar.

tphankr avatar Nov 10 '22 01:11 tphankr