SoftMax Layer giving incorrect results
softmax layer is giving incorrect results for my given inputs. The wrapper file which i used is attached and the input binary file provided is also attached. When i compared with the cudnn softmax layer output for the same input,There is mismatch between the results. The Expected Results(outputs of softmax layer - cudnn) are also attached.
used Latest ARM Compute Library ARM_NEON (ARM Cortex v7) Tested on Raspberry Pi3 -- Arch Linux
Makefile -> makesftm.txt cpp source file->sftm.txt input.txt softmax_obtainedOutput.txt softmax_DesiredOutput.txt
Hello @BhaskarsarmaP,
Can you provide us on how you calculate the reference as well?
Hi @BhaskarsarmaP
I've been looking at your code and I found an issue, the function fillIpToTensor() doesn't seem to work properly and the values in the input tensor are not properly filled.
You can see this if you just add the following code just after the call to fill the input tensor
src.print(std::cout,IOFormatInfo::PrintRegion::Full);
The way the code loads the values from the 'input.bin' file doesn't seem to work, the attached input.txt file is not binary so the code pFile = fopen("input.txt","rb"); is not the good way to open the input file.
I modified the code to parse the input.txt file properly but the output tensor still contains smaller numbers from what you expect 'softmax_DesiredOutput.txt'.
Could you please provide the information requested by @GeorgeARM?
Hi @BhaskarsarmaP
Another question: In your example there are 3 Channels, when you load the input values from the file what data layout do you assume? NCHW or NHWC? What's the layout of the input.txt file attached above?
Hi @morgolock I was unable to attach the binary file.so i attached the test file to you. The desired output test file is obtained when i tested the softmax layer with cudnn
Hi @BhaskarsarmaP
Could you please share the cudnn code you use to generate the values in 'softmax_DesiredOutput.txt' ?
Hi @BhaskarsarmaP
I was looking at the values in 'softmax_DesiredOutput.txt' and something seems wrong, the sum of all these values is supposed to be close to 1 and currently is ~ 1023.999625
The values you use as reference seem to be scaled up by 1000.
No problem with the Compute Library as far as we can tell, and not enough user information.
Closing for now (Re-open if you've got more information to provide)