Nvidia Classification results using InceptionV3 transfer learning and GPU coder do not match the classification results using Matlab itself
조회 수: 3 (최근 30일)
이전 댓글 표시
i use imageDatastore, augmentedImageDatastore to convert the different size of gray scale images to the 3 channels RGB images,
*****
imds1 = imageDatastore('folderpath',true,'LabelSource','foldernames');
imageAugmenter = imageDataAugmenter( ...
'RandXReflection',0, ...
'RandScale',[0.7 1.3],...
'RandXShear',[-2 2]);
[trainImgs, valImgs] = splitEachLabel (imds1,08.,0.2,'randomize');
trainImgs1 = augmentedImageDatastore(.. 'ColorPreprocessing','gray2rgb','DataAugmentation',imageAugmenter);
...
then train InceptionV3 using my own image dataset.
The created model is then compiled using GPU coder for Nvidia device.
The compiled wrapper file runtime in Nividia gives different output from the matlab environment when running the trained model. Additional information for this, my raw image is preprocessed in the wrapper file (using openCV - resize, then cvColor to convert grayscale to color images).then, feed into the trained model. However, the model was trained by augmentedImageDatastore, I do not know exactly what processing is done for ColorPreprocessing and gray2rgg.
Can any one give suggestions how to fix the issue?
Thanks!
댓글 수: 0
답변 (1개)
Hariprasad Ravishankar
2022년 12월 7일
This looks similar to https://www.mathworks.com/matlabcentral/answers/1870912-deep-learning-classification-results-for-images-in-matlab-are-different-from-the-application-compile which you recently posted.
As clarified through our support team, we suspect that this might be because you are generating code that expects the image in column major layout whereas the opencv imread function and the BGR to RGB processing returns data in row-major layout.
Consider transposing the input from row-major to column-major before calling the auto generated function.
Hari
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!