BCEWithLogitsLoss报错RuntimeError: result type Float can't be cast to the desired output type Long

发布时间 2023-10-07 22:49:49作者: oneDonkey

loss = F.binary_cross_entropy_with_logits(input, target)

input错写成了Long类型,target错写成了Int类型

input与target需要的是float类型