arjun.a
embed files
325bfe1
raw
history blame
5.86 kB
Ticket Name: TDA2PXEVM: Mismatch between TIDL host emulation tool and target board TDA2Px EVM File I/O use case
Query Text:
Part Number: TDA2PXEVM Hi, I used TIDL import tool to convert a TensorFlow model, then I used the host emulation tool to check the output of the model after conversion. I found that the output is acceptable after quantization. Then, I used TIDL file I/O use case to check the output on the board and compare it to the output of the host emulation tool. However, I find a great mismatch between the two outputs. The output from the target is mostly zeros, which is completely different from the host emulation tool output. I searched on the forum, but did not find a systematic way to debug the cause of this difference. I specify the following parameters in the TIDLCFG.TXT file: inputWidth=128
inputHeight=32
inputFile=IN.bin
outputFile=OUT.bin
netFileName=NET.bin
paramFileName=PRM.bin Would you please let me know what is the cause of this issue, or how to appropriately debug it ? Thanks, Ahmed Anwar
Responses:
Hi Ahmed Anwar, In the TIDL file I/O use case, which core did you select to run TIDL? Kindly check with both the cores and isolate if this issue is specific to any core (EVE/DSP) ? Thanks, Praveen
Hi Praveen, I checked both cores. The problem is the same whether I choose EVE or DSP. The output is completely different from the host emulation tool output, with the majority of zero values. Thanks, Ahmed Anwar
Hi Praveen, I noticed that the output file size from the File I/O use case on TDA2PX EVM is not equal to the output file size from the host emulation tool. The output file size from the host emulation tool = 96 bytes. This size is correct and was expected, as I have 96 values in the output of my model, and if each value is represented by 1 byte, so the output file size should be 96 bytes. When I read this 96 byte file as int8, the output is reasonable, and I was expecting to find the same output with the same size on target. However, the output file size from the File I/O use case = 4.1 KB, which is not equal to the 96 byte file I get from the host emulation tool. Would you please explain how I get different file sizes from the host emulation tool and File I/O use case, given that I use the same model and input files? And if you have any idea about this mismatch problem in general, please let me know. Thanks, Ahmed Anwar
Hi Ahmed Anwar, You are getting output file size of 4.1KB (which is 128x32) because FILE I/O usecase dumps output considering it as segmentation application, so it writes output data considering input dimension. If your application is not segmentation, then you may need to provide the output dimension to the usecase and dump the actual output of 96 bytes, for this you need to modify the dump code in the usecase and for this modified code please refer to last post in the below thread. https://e2e.ti.com/support/processors-group/processors/f/processors-forum/874558/tda2-ti-vision-sdk---tidl---verifying-that-inceptionv1-works-with-tidl/3240125#3240125 Thanks, Praveen
Hi Praveen, Thank you for your reply. I will try to edit the dumping code in the use case based on the post you provided. Until I modify the code, I have this question, by which I try to figure out if the correct 96 bytes are present within the 4096 bytes or not: Does the 4096 byte output (32 * 128) have the actual 96 output ? When the use case dumps 4096 values, does it dump my actual 96 values (Which are the output of the model) and dumps also other values to complete the 4096 bytes ? If this is the case, I need to understand these points: How can I get the actual 96 byte output of the 4096 bytes ? Is there an offset to start extracting the actual output from ? Are the wrongly dumped bytes (other than the correct 96 bytes) all zeros ? If not, how there values are determined, if the actual model has only 96 bytes output ? Would you please answer my question till I modify the code and test the use case after modification ? Thanks, Ahmed Anwar
Hi Praveen, I changed the use case code based on the post you provided, and rebuilt the SDK. The output file size is now correct. However, the output is not correct and does not match the host emulation tool output. Most of the values are zeros, which is completely different from the host emulation tool output. Would you please help me in identifying the cause of this mismatch ? Thanks, Ahmed Anwar
Hi Praveen, I also have a question regarding that the File I/O use case is used for segmentation. My application is not segmentation, does this make an issue ? I added the output height and width to the use case code as you said, but the output is not correct. Is it ok to use the File I/O use case with a model which is not used for segmentation ? Thanks, Ahmed Anwar
Hi Ahemd Anwar, Could you please provide some details about your application. Also, kindly confirm that you had updated "dmaPrm.srcPitch[0]" and "dmaPrm.destPitch[0]" with outWidth as these can effect the offset in output buffer. Thanks, Praveen
Hi Praveen, My application is classification. I confirm that I updated "dmaPrm.srcPitch[0]" and "dmaPrm.destPitch[0]" with outWidth. Thanks, Ahmed Anwar
Hi Praveen, Is there a difference between the way of execution of the host emulation tool and the File I/O use case on target ? I need to understand this, as it is supposed to be the same, and it is supposed to get on target the same output that I get using the host emulation tool. I think that getting good results using the host emulation tool means that the conversion and quantization are done in a good way, and that I can go on with deploying the model to the board. I need to understand if there is differences between the source code that runs the host emulation tool and the File I/O use case, as they produce different results. Thanks, Ahmed Anwar