Error using classreg.l​earning.Fu​llClassifi​cationRegr​essionMode​l.prepareD​ataCR (line 213) X must be a numeric matrix.

10 次查看(过去 30 天)
Why do I get this error when running the "Deep Learning Example: Feature Extraction using AlexNet and CIFAR-10 Dataset"?
"Error using classreg.learning.FullClassificationRegressionModel.prepareDataCR (line 213) X must be a numeric matrix."
  4 个评论
Guillaume
Guillaume 2019-11-1
I don't have the toolbox so can't test the example.
The obvious question is what is X then? Set matlab to break into the debugger when it encounters an error with:
dbstop if error
run the example the code and when it breaks into the debugger, look at the class and content of X.
Adam Danz
Adam Danz 2019-11-1
I googled the demo you mentioned because no link was provided. It led to a file exchange by Math Works and someone else has recently left a comment on that page with the same error. Actually, there are quite a few errors listed in the comments.
I'm unfamiliar with the toolbox and we don't have much info here. If the demo is just meant to be run without any user inputs then the error may be due to an incompatible matlab release/version.

请先登录,再进行评论。

回答(2 个)

Chirdpong Deelertpaiboon
I hope this is not too late for your question. I just found the answer from this post
This works for me. There are two lines from the example code that need to correct. The first one is
trainingFeatures = activations(convnet, trainingSet, featureLayer,'OutputAs','rows');
The second one is
testFeatures = activations(convnet, testSet, featureLayer,'OutputAs','rows');

Melvyn Smith
Melvyn Smith 2019-11-1
Yes, I see those comments also. That page does not seem to be a forum for getting help (lots of questions but no answers). Actually, there does not seem to be much help and guidance available generally for MATLAB and deep learning. I've only found a couple of books and nothing really good on-line. Maybe MATLB is not the way to go and something like Python or Java is better. I am trying to get into CNNs. I read several books and feel I know the underlying concepts. Unfortunately, the valley of death seems to be going from that to coding CNNs for one's own applications.

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by