Hello.I have a question and I hope everyone will help me.
I am predicting an image by my model.
I don’t know the meaning of tensor([[-4,8724,4,9577]]).I thinks when i write model(image),it will return a vector is probabilities of 2 classes.But it not.
Please explain to me
p/s: I am beginner in English so my enlish is not good.I am so sorry about that.Thanks you
What does your model looks like? I expect that u used CrossEntropyLoss
, in that case, to obtain the probability, use output.softmax(1)
.
i used crossentropy loss and my model is mobilenetv2
Ok, u should apply a softmax to the output to get the probability since CrossEntropyLoss
is a combination of LogSoftmax
and NLLLoss
.