Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tphankr opened this issue Jul 22, 2021 · 4 comments

Comments

@tphankr
Copy link

tphankr commented Jul 22, 2021

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.

@nikhilroxtomar
Copy link
Owner

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?

@tphankr
Copy link
Author

tphankr commented Jul 23, 2021

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

Thank you @nikhilroxtomar

@auger1
Copy link

auger1 commented Nov 9, 2022

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

@tphankr
Copy link
Author

tphankr commented Nov 10, 2022

Thank you very much @auger1 and @nikhilroxtomar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants