Skip to content

BCELoss target requires float format #2220

@zzzace2000

Description

@zzzace2000

Hi,

I find that BCELoss target require float tensor, which is wierd. It should accept LongTensor or IntTensor for a binary classification (0 or 1) right?

This is the error message I get.

TypeError: FloatBCECriterion_updateOutput received an invalid combination of arguments - got (int, torch.FloatTensor, torch.LongTensor, torch.FloatTensor, bool, NoneType), but expected (int state, torch.FloatTensor input, torch.FloatTensor target, torch.FloatTensor output, bool sizeAverage, [torch.FloatTensor weights or None])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions