Error in matlab MCR undefined variable nnMex

1 view (last 30 days)
lpf
lpf on 21 Sep 2023
Edited: lpf on 21 Sep 2023
Hi, can you help solve this problem?
I have implemented a MATLAB program, written as:
function an =predict(testdata)
testdata = cell2mat(testdata);
%#function nnMex
load('my_net.mat', 'net_3')
input = testdata.';
an = net_3(input);
end
Actually, it's just using models to make predictions. I installed MATLAB_ MCR in another environment CentOS7.
I simply tested the Python algorithm. Codes are here:
import predict
a = predict.initialize()
b = a.predict([10.0,26.0,46.0,54.0,1.1356])
print(b)
a.terminate()
there was an undefined variable "nnMex" or class "nnMex. yy" error. The details are here;
Traceback (most recent call last):
File "est.py", line 3, in <module>
b = a.predict([10.0,26.0,46.0,54.0,1.1356])
File "/usr/local/MATLAB/MATLAB_Runtime/v95/toolbox/compiler_sdk/pysdk_py/matlab_pysdk/runtime/deployablefunc.py", line 80, in __call__
nlhsWasSpecified, stdoutObj, stderrObj).result()
File "/usr/local/MATLAB/MATLAB_Runtime/v95/toolbox/compiler_sdk/pysdk_py/matlab_pysdk/runtime/futureresult.py", line 135, in result
raise e
File "/usr/local/MATLAB/MATLAB_Runtime/v95/toolbox/compiler_sdk/pysdk_py/matlab_pysdk/runtime/futureresult.py", line 123, in result
raise e
File "/usr/local/MATLAB/MATLAB_Runtime/v95/toolbox/compiler_sdk/pysdk_py/matlab_pysdk/runtime/futureresult.py", line 113, in result
self._nlhs, out=self._out, err=self._err)
matlab_pysdk.runtime.MatlabRuntimeError: An error occurred when evaluating the result from a function. Details:
File /home/alg/.mcrCache9.5/predic0/toolbox/nnet/nnet/nnderivative/+nnMex/y.m, line 8, in y
File /home/alg/.mcrCache9.5/predic0/toolbox/nnet/nnet/nnderivative/nnCalcLib.m, line 113, in nnCalcLib.y
File /home/alg/.mcrCache9.5/predic0/toolbox/nnet/nnet/@network/sim.p, line 353, in simPerWorker
File /home/alg/.mcrCache9.5/predic0/toolbox/nnet/nnet/@network/sim.p, line 305, in sim
File /home/alg/.mcrCache9.5/predic0/toolbox/nnet/nnet/@network/subsref.m, line 15, in subsref
File /home/alg/.mcrCache9.5/predic0/predict/predict.m, line 8, in predict
Undefined variable "nnMex" or class "nnMex.yy".

Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!