Error using .' Transpose on ND array is not defined. Use PERMUTE instead.

I have this code but it give to me this error, how I can fix it?
% Pass CNN image features to trained classifier
predictedLabels = predict(classifier, testFeatures); _this is the code I want to compile_
[X,varargin] = orientX(X,expectedObsInRows,varargin)
% Copyright 2015 The MathWorks, Inc.
[obsIn,~,varargin] = ...
internal.stats.parseArgs({'observationsin'},{'rows'},varargin{:});
obsIn = validatestring(obsIn,{'rows' 'columns'},...
'classreg.learning.internal.orientX','ObservationsIn');
obsInRows = strcmp(obsIn,'rows');
if expectedObsInRows~=obsInRows
X = X.'; _at this line I have the error mentioned_
end
end
Thank you so much

Antworten (1)

Walter Roberson
Walter Roberson am 22 Apr. 2018

0 Stimmen

Your testFeatures needs to be 2D, not 3D.
Be careful if you are working with images: RGB images are 3D.

3 Kommentare

Paola Perrone
Paola Perrone am 23 Apr. 2018
Bearbeitet: Paola Perrone am 23 Apr. 2018
How I can change my input? With rgbtogray? But my input to convent must be 227by227by3, maybe I have to change only testFeatures?
I also receive same error. I check my X is 4D. How i will know which row-columns i need to rearrange using premute?
did you get the solution to this problem @Paola Perrone?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 22 Apr. 2018

Kommentiert:

am 11 Feb. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by