필터 지우기
필터 지우기

Nvidia Classification results using InceptionV3 transfer learning and GPU coder do not match the classification results using Matlab itself

조회 수: 1 (최근 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!

답변 (1개)

Hariprasad Ravishankar
Hariprasad Ravishankar 2022년 12월 7일
Hi @Liwei,
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 CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by