wrong classification caffe google net model in matlab

조회 수: 4 (최근 30일)
nitin kandpal
nitin kandpal 2019년 10월 6일
댓글: Piyush Dubey 2019년 10월 10일
Hi all,
I trained a google net model for two claases in Nvidia DIGITS which is working well in in DIGITS6.0 with 99.7 accuracy in test set.
Same model imported in matlab not able to classify properly. I am thinking it has to do something with mean image or binary.proto file.
I am not getting any error just wrong classification and i am sure my network is woking properly in DIGITS6.0 and python.
below is the matlab code
protofile = 'deploy.prototxt';
datafile = 'snapshot_iter_2295.caffemodel';
net = importCaffeNetwork(protofile,datafile);
inputSize = net.Layers(1).InputSize;
% image path
img = 'Test/Normal/0.JPEG';
im1 = imread(img);
im2 = rgb2gray(im1);
im = imresize(im2,inputSize(1:2)) ;
[label,score] = classify(net,im); % Classify the picture
Thanks
Nitin
  댓글 수: 1
Piyush Dubey
Piyush Dubey 2019년 10월 10일
Hi Nitin,
When you obtain 'im2' by using 'rgb2gray' function, the image size changes from [224 224 3] to [224 224]. When you try to classify it, you should get an error saying 'Incorrect input size. The input images must have a size of [224 224 3].'. Can you try classifying after removing the following line from your code:
im2 = rgb2gray(im1);
And changing the line where you resize the image im2 to the following:
im = imresize(im1, inputSize(1:2));
Also, see if the following link can help:

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by