Error running matlab convolutional network from c#
1 ビュー (過去 30 日間)
I am trying to develop a Xamarin mobile app for android that recognizes objects on images taken for the user, basically I already trained the CNN on matlab and the plan is to call it from a c# web service!.
I wrote this piece of code in a .m file , and I converted it into a .net assembly using the Matlab deploying tool.
function label = RedNeuronal()
I = imread(newImage);
I = cat(3,I,I,I);
img = imresize(I, [227 227]);
imageFeatures = activations(convnet, img, featureLayer);
label = char(predict(classifier, imageFeatures));
As you can notice this code simply loads the CNN , the name of the feature layer and also a SVM, finally it preprocess the image and get the result using the predict command. If i run this .m fie from matlab it runs perfectly.
On the other hand, in c# I wrote this piece of code:
static void Main(string args)
MWArray SalidaCNN = null;
MLCnnClass CNN = new MLCnnClass();
But Sadly this code gives me the following error:
It seems that it can not use the CNN , like if it would not have access to the toolbox or something. What should I do ?
回答 (1 件)
Walter Roberson 2017 年 1 月 5 日
I advise against using load() without an output parameter in a compiled module. You are relying upon variables being "poofed" into existence, which is something that the compiler can have difficulty in figuring out.