How can I solve this Matlab path problem?

2 views (last 30 days)
Elisa Zazzera
Elisa Zazzera on 2 Nov 2020
Edited: Miranda Ramirez on 18 Mar 2021
Good morning,
I'm trying to specify and run a PRoNTo model, but after the model specification, when I click in the option "specify and run the model" the following errors occur:
prt_machine: machine did not run sucessfully.
SOLUTION: Please read the message below and attempt to correct the problem, or ask the developpers for assistance by copy-pasting all messages and explaining the exact steps that led to the problem.
These kinds of issues are typically caused by Matlab path problems.
8 : function [@(hObject,eventdata)prt_ui_model('buildbutt_Callback',hObject,eventdata,guidata(hObject))] in file [/Applications/MATLAB_R2018a.app/toolbox/matlab/graphics/+matlab/+graphics/+internal/+figfile/@FigFile/read.m] at line [0]
7 : function [prt_ui_model] in file [/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/prt_ui_model.m] at line [50]
6 : function [gui_mainfcn] in file [/Applications/MATLAB_R2018a.app/toolbox/matlab/guide/gui_mainfcn.m] at line [95]
5 : function [buildbutt_Callback] in file [/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/prt_ui_model.m] at line [1171]
4 : function [prt_cv_model] in file [/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/prt_cv_model.m] at line [101]
3 : function [prt_cv_fold] in file [/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/prt_cv_fold.m] at line [76]
2 : function [prt_machine] in file [/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/machines/prt_machine.m] at line [229]
1 : function [prt_machine_svm_bin] in file [/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/machines/prt_machine_svm_bin.m] at line [100]
Warning: Prediction method did not return [Error running machine
prt_machine_svm_bin: MATLAB:mex:ErrInvalidMEXFile Invalid MEX-file
'/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/machines/libsvm-3.20/matlab/svmtrain.mexmaci64':
dlopen(/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/machines/libsvm-3.20/matlab/svmtrain.mexmaci64,
6): Library not loaded: @loader_path/libmex.dylib
Referenced from:
/Users/elisazazzera/Documents/MATLAB/PRoNTo_dev/machines/libsvm-3.20/matlab/svmtrain.mexmaci64
Reason: image not found.]
> In prt_cv_fold (line 78)
In prt_cv_model (line 101)
In prt_ui_model>buildbutt_Callback (line 1171)
In gui_mainfcn (line 95)
In prt_ui_model (line 50)
In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)prt_ui_model('buildbutt_Callback',hObject,eventdata,guidata(hObject))
Warning: model.type not specified, defaulting to classifier
> In prt_stats (line 35)
In prt_cv_model (line 114)
In prt_ui_model>buildbutt_Callback (line 1171)
In gui_mainfcn (line 95)
In prt_ui_model (line 50)
In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)prt_ui_model('buildbutt_Callback',hObject,eventdata,guidata(hObject))
Index in position 1 is invalid. Array indices must be positive integers or
logical values.
Error in prt_stats>compute_stats_classifier (line 68)
stats.con_mat(pred_lb,true_lb) = stats.con_mat(pred_lb,true_lb) + 1;
Error in prt_stats (line 43)
stats = compute_stats_classifier(model, tte, nk);
Error in prt_cv_model (line 114)
stats = prt_stats(model, targets.test, nc); %targets.train
Error in prt_ui_model>buildbutt_Callback (line 1171)
prt_cv_model(PRT, in);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in prt_ui_model (line 50)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)prt_ui_model('buildbutt_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
The solution (in bold type) indicates that the problem involves the Matlab path, but I do not understand what to do. Can you help me?
Elisa

Answers (1)

Miranda Ramirez
Miranda Ramirez on 18 Mar 2021
Edited: Miranda Ramirez on 18 Mar 2021
Hello - This is from the PRoNTo manual. I ran into this same issue and followed these instructions and was able to get it to work.
Microsoft Windows
Make sure you have a C++ compiler install. If not, you can install Microsoft Visual C/C++;
Copy the libsvm folder to the `machines' directory of your PRoNTo instalation
(e.g. C:\PRoNTo\machines\);
Open a DOS command window and change to the libsvm folder in the previous step (cd
C:\PRoNTo\machines\libsvm-3.17\). If the environment variables of VC++ have not
been set, run the following command:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat. This command
might be dierent, depending on the path of your Visual Studio installation;
In the libsvm folder run the command: nmake -f Makefile.win clean all
If no errors appear, open MATLAB;
Change to the `matlab' folder inside the libsvm folder (e.g. C:\PRoNTo\machines\libsvm-
3.17 \matlab\);
Run make in the MATLAB Command Window. If there are no errors, you have just
successfully compiled libsvm to be used with MATLAB.
Remember, if you want to use the version that you have just compiled, you have to add the
libsvm folder to your path in MATLAB. If you have more than one libsvm folder inside the
`machines' folder, please remove one of them from the MATLAB path. You should only have one
libsvm folder in your path.
Unix (Mac OS or Linux)
Make sure you have a C++ compiler installed. If you are using Mac OS, please install
`Xcode'. On Linux systems, you should already have `gcc' installed;
Copy the libsvm folder to the `machines' directory of your PRoNTo instalation
(e.g. /home/<username>/PRoNTo/machines/);
Open a terminal window and change to the `machines' directory: cd PRoNTo/machines/
Compile libsvm by running the following command: make
If no errors appear, open MATLAB;
Change to the `matlab' folder inside the libsvm folder (e.g. PRoNTo/machines/libsvm-
3.17/matlab/);
Run make in the MATLAB Command Window. If there are no errors, you have just
successfully compiled libsvm to be used with MATLAB.
Remember, if you want to use the version that you have just compiled, you have to add the
libsvm folder to your path in MATLAB. If you have more than one libsvm folder inside the
`machines' folder, please remove one of them from the MATLAB path. You should only have one
libsvm folder in your path.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!