Tool/software: Jupyter Notebook
Hello,
I am currently using Processor SDK LINUX 10.00.00.08, Processor SDK RTOS 10.00.00.05, and EdgeAI TIDL 10_00_08_00.
My inference results with custom models on the EVM are poorer than those obtained during a previous study (same notebook, same model) using the older SDK version 08.01.00.02. I have noticed that the accuracy is also lower, and the performance is not as good, even though I am using the exact same model file as before.
When I compile the model with the options `tensor_bits=8` and `calibration_iterations=16`, I find that the inference results are incorrect if I use the same preprocessing function given by edgeai_tidl_tool example :
def preprocess(image_path, size, mean, scale, layout, reverse_channels): # Step 1 img = cv2.imread(image_path) # Step 2 img = img[:,:,::-1] # Step 3 img = cv2.resize(img, (size[1], size[0]), interpolation=cv2.INTER_CUBIC) # Step 4 img = img.astype('float32') for mean, scale, ch in zip(mean, scale, range(img.shape[2])): img[:,:,ch] = ((img.astype('float32')[:,:,ch] - mean) * scale) # Step 5 if reverse_channels: img = img[:,:,::-1] # Step 6 if layout == 'NCHW': img = np.expand_dims(np.transpose(img, (2,0,1)),axis=0) else: img = np.expand_dims(img,axis=0) return img
However, when I compile with other options, the inference produces correct results (see notebook).
So I tried an other preprocessing function for the inference with the compilation options `tensor_bits=8` and `calibration_iterations=16`. Now, I am able to achieve inference with correct results, but the accuracy obtained is lower : 80% instead of 90%.
Could you please provide insights into the potential causes of this difference? Furthermore, I would appreciate any suggestions on changes I might implement to enhance my results.
The model used with the notebook used (from jupyter notebook example of edgeai_tidl_tool) :
Thank you for your assistance.
Best regards,
Azer