Error in matlab MCR undefined variable nnMex
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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".
0 Kommentare
Antworten (1)
Hitesh
am 27 Jan. 2025
Hi Ipf,
The error message you're encountering indicates that there is an undefined variable or class "nnMex" in your MATLAB code.This is due to MATLAB Compiler Runtime version installed on your CentOS7 environment does not matches the version used to compile the MATLAB code. The workaround would be to reinstall the same version. Compatibility issues can sometimes lead to such errors as there are some functions are defined in one version which is not present in another version.
0 Kommentare
Siehe auch
Kategorien
Mehr zu MATLAB Compiler SDK finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!