Интегрировать обученную нейронную сеть с помощью Matlab в Java - PullRequest
0 голосов
/ 04 мая 2011

Я работаю над своим последним проектом года. Мне нужно загрузить нейронную сеть Matlab из Java.

Это метод, который я создал для загрузки нейронной сети:

     function [result] =  viewforecasteddata(newinputs)
     %#function network 
     load('Test.mat','net');
     result = net(newinputs);

конец

Вот как я звоню с Java:

    result = theCost.viewforecasteddata(1,mWNumericArray);

Я получаю эти предупреждения и исключения:

{Warning: While loading an object of class 'nnetWeight':
Undefined function or method 'initzero' for input arguments of type 'char'.} 
> In viewforecasteddata at 3
{Warning: While loading an object of class 'nnetWeight':
Undefined function or method 'initzero' for input arguments of type 'char'.} 
> In viewforecasteddata at 3
{Warning: An error occurred when running a class's loadobj method. The object
that was loaded from the MAT-file was a copy of the object before the loadobj
method was run. The rest of the variables were also loaded from the MAT-file.
The encountered error was:
Reference to non-existent field 'net_read_only'.
} 
> In viewforecasteddata at 3
{??? Undefined function or method 'initzero' for input arguments of type 'char'.

Error in ==> viewforecasteddata at 4


} 
... Matlab M-code Stack Trace ...
file C:\Users\knishe\AppData\Local\Temp\knishe\mcrCache7.14\costmo62\costmodelpkg\viewforecasteddata.m, name viewforecasteddata, line 4.
com.mathworks.toolbox.javabuilder.MWException: Undefined function or method 'initzero' for input arguments of type 'char'.
        at com.mathworks.toolbox.javabuilder.internal.MWMCR.mclFeval(Native Method)
        at com.mathworks.toolbox.javabuilder.internal.MWMCR.access$600(MWMCR.java:23)
        at com.mathworks.toolbox.javabuilder.internal.MWMCR$6.mclFeval(MWMCR.java:902)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.mathworks.toolbox.javabuilder.internal.MWMCR$5.invoke(MWMCR.java:800)
        at $Proxy0.mclFeval(Unknown Source)
        at com.mathworks.toolbox.javabuilder.internal.MWMCR.invoke(MWMCR.java:475)
        at costmodelpkg.CostModel.viewforecasteddata(CostModel.java:218)
        at testmatlab.Main.main(Main.java:41)
BUILD SUCCESSFUL (total time: 8 seconds)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...