KhronosGroup / NNEF-Tools

The NNEF Tools repository contains tools to generate and consume NNEF documents
https://www.khronos.org/nnef
222 stars 57 forks source link

Missing softmax layer #111

Closed hansely closed 4 years ago

hansely commented 4 years ago

I was working on some of the NNEF models from model zoo and found out that some of them were missing softmax layer at the end.

For example, I verified that vgg19 model from onnx has softmax layer at the end. However, the converted vgg19 NNEF model is missing it so that all the values of the output tensor looks weird. (e.g. having negative values and all the values not adding up to 1). On the other hand, the alexnet model does include the softmax layer and the output tensor has correct values as well. Is this intended? Or is it a bug?

gyenesvi commented 4 years ago

How did you verify that? If I take the ONNX link in the model zoo in this repo (the one from which the NNEF model is converted) and view it with Netron, then I do not see softmax layer at the end (last op is a matmul). So it does not seem to be a bug, but that's how the original model comes.

hansely commented 4 years ago

Oh I checked it again and verified that last op is a matmul. However, that output tensor values are still not adding up to 1. Is this intended result? Can you check if this occurs to you as well?

gyenesvi commented 4 years ago

Why would they add up to 1 in case of a matmul? Those are the pre-softmax values. You have to add the softmax on top and then they will add up to 1.

hansely commented 4 years ago

I see. So it's not a bug or anything. Thanks. I will close this issue.