Closed ghost closed 1 year ago
Hi Lam, I am not sure what steps you take. In general, you just need to do the following steps:
In order to compile it, you need to have "Deep Learning Toolbox Converter for ONNX Model Format" or uncheck "Deploy Imported..." in the Suggested support packages section. The easiest way to install the package is by typing "exportONNXNetwork" in Matlab command prompt and hit the provided link to install the package.
I hope this helps! Ilya
Hi @Ajaxels
Thank you for your quick reply. I tried following your guide but encountered the same error. Please check below.
I'm using Matlab R2023a Trial Version on Windows 10 21H2 x64 (I'm doubting that I might need to use R2021b???).
Start Matlab and navigate to MIB folder.
Load MIB
run('D:\tmp\MIB2-2.840\mib.m') MIB installation path: D:\tmp\MIB2-2.840 Warning: IM2JAVA will be removed in a future release. In im2java (line 64) In mibController (line 534) In mib (line 113) In run (line 91) MIB parameters file: C:\Users\Z036650\Matlab\mib.mat MIB: adding "D:\tmp\MIB2-2.840\jars\mij.jar" to Matlab java path MIB: adding "D:\tmp\MIB2-2.840\jars\BioFormats\bioformats_package.jar" to Matlab java path MIB: adding "D:\tmp\MIB2-2.840\jars\ImageSelection" to Matlab java path MIB: adding "D:\tmp\MIB2-2.840\jars\MLDropTarget" to Matlab java path Drag and drop of files to the Image View panel: ENABLED Elapsed time is 20.508855 seconds.
Proof for having installed those packages
exportONNXNetwork Not enough input arguments. Error in exportONNXNetwork (line 41) nnet.internal.cnn.onnx.exportONNXNetwork(Network, filename, varargin{:});
And the error showed up
My thoughts: A. I just realized that I havent't followed the detailed instructions in http://mib.helsinki.fi/help/main2/im_browser_system_requirements.html However, this is unlikely to be the cause of the above error. I will try following the detailed instructions and report later.
B. I'm thinking that the above error has something to do with the installation path of addons for Matlab.
I used grep to see that the listed path for addSpkgBinPath.m does not exist in my system for R2023a.
23/05/2023 15:57.47 /mnt/d/tmp/MIB2-2.840 grep -n addSp *
MIB.prj:219:
Do you have any suggestions how I should approach this problem?
C. I'm trying to use Matlab R2021b to compile again, however I'm still in the middle of installing Toolboxes. I will update later.
Thanks, Lam
There are may be few issues with that but try this:
use the recent version of Matlab
in the Settings check that the paths are targeting to the correct locations:
Check deploy imported models for ONNX Model format...
Dear @Ajaxels
Thank you for your information. Finally I have successfully compiled MIB on Matlab R2023a. I have made a few changes in the Project File to change to R2023a paths, and also excluded BMxD Image Filters due to license problem.
I included here the log of my compilation and the new project file for Matlab R2023a (for future reference).
` mcc -a C:\ProgramData\MATLAB\SupportPackages\R2023a\toolbox\nnet\supportpackages\onnx\ -a C:\ProgramData\MATLAB\SupportPackages\R2023a\resources\nnet_cnn_onnx\ -a C:\ProgramData\MATLAB\SupportPackages\R2023a\bin\win64\ -o MIB -W 'WinMain:MIB,version=2.84' -T link:exe -d D:\tmp\MIB2-2.840\MIB_R2023a\for_testing -v D:\tmp\MIB2-2.840\mib_deploy.m -a D:\tmp\MIB2-2.840\Classes -a D:\tmp\MIB2-2.840\GuiTools -a D:\tmp\MIB2-2.840\ImportExportTools -a D:\tmp\MIB2-2.840\Plugins -a D:\tmp\MIB2-2.840\Tools -r 'C:\Program Files\MATLABTrial\R2023a\toolbox\compiler\packagingResources\default_icon.ico' -Z 'Deep Learning Toolbox Converter for ONNX Model Format' -Z 'Deep Learning Toolbox Model for ResNet-50 Network' -Z 'Deep Learning Toolbox Model for Xception Network' -Z 'Deep Learning Toolbox Model for ResNet-18 Network' Compiler version: 8.6 (R2023a)
Analyzing file dependencies.
Warning: File: mibGetMorphMask.m Line: 87 Column: 21 The temporary variable 'bw' will be cleared at the beginning of each iteration of the parfor-loop. If 'bw' is used before it is set, a runtime error will occur. For more information, see Parallel for Loops in MATLAB, "Uninitialized Temporaries". Warning: File: mibGetMorphMask.m Line: 106 Column: 21 The temporary variable 'bw' will be cleared at the beginning of each iteration of the parfor-loop. If 'bw' is used before it is set, a runtime error will occur. For more information, see Parallel for Loops in MATLAB, "Uninitialized Temporaries". Warning: File: mibGetMorphMask.m Line: 124 Column: 21 The temporary variable 'bw' will be cleared at the beginning of each iteration of the parfor-loop. If 'bw' is used before it is set, a runtime error will occur. For more information, see Parallel for Loops in MATLAB, "Uninitialized Temporaries". Warning: File: mibGetMorphMask.m Line: 87 Column: 21 The temporary variable 'bw' will be cleared at the beginning of each iteration of the parfor-loop. If 'bw' is used before it is set, a runtime error will occur. For more information, see Parallel for Loops in MATLAB, "Uninitialized Temporaries". Warning: File: mibGetMorphMask.m Line: 106 Column: 21 The temporary variable 'bw' will be cleared at the beginning of each iteration of the parfor-loop. If 'bw' is used before it is set, a runtime error will occur. For more information, see Parallel for Loops in MATLAB, "Uninitialized Temporaries". Warning: File: mibGetMorphMask.m Line: 124 Column: 21 The temporary variable 'bw' will be cleared at the beginning of each iteration of the parfor-loop. If 'bw' is used before it is set, a runtime error will occur. For more information, see Parallel for Loops in MATLAB, "Uninitialized Temporaries". Warning: In "C:\ProgramData\MATLAB\SupportPackages\R2023a\toolbox\nnet\supportpackages\resnet18+nnet+internal+app+plugins\ResNet18Repository.m", "nnet.internal.app.plugins.Repository" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "C:\ProgramData\MATLAB\SupportPackages\R2023a\toolbox\nnet\supportpackages\resnet18+nnet+resnet18+internal+app+layer\ResNet18PreprocessingLayerTemplate.m", "nnet.internal.app.plugins.DeferredPropertiesLayerTemplate" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "C:\ProgramData\MATLAB\SupportPackages\R2023a\toolbox\nnet\supportpackages\xception+nnet+internal+app+plugins\XceptionRepository.m", "nnet.internal.app.plugins.Repository" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "C:\ProgramData\MATLAB\SupportPackages\R2023a\toolbox\nnet\supportpackages\xception+nnet+xception+internal+app+layer\XceptionPreprocessingLayerTemplate.m", "nnet.internal.app.plugins.DeferredPropertiesLayerTemplate" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "D:\tmp\MIB2-2.840\Classes\@mibDeepController\mibDeepController.m", "analyzeNetwork" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "D:\tmp\MIB2-2.840\ImportExportTools\nrrd\compilethis.m", "mex" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "D:\tmp\MIB2-2.840\Tools\FastMarching\compile_c_files.m", "mex" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "D:\tmp\MIB2-2.840\Tools\RandomForest\RF_Class_C\compile_windows.m", "mex" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "D:\tmp\MIB2-2.840\Tools\RegionGrowing\regiongrowing.m", "mex" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "D:\tmp\MIB2-2.840\Tools\Supervoxels\compile_c_files.m", "mex" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: In "D:\tmp\MIB2-2.840\Tools\mib_compile_c_files.m", "mex" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/images/imdata/cameraman.tif"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/images/imdata/coins.png"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/images/imuitools/imtool.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/images/imuitools/volumeViewer.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/matlab/codetools/+matlab/+desktop/+editor/getActive.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/matlab/codetools/+matlab/+desktop/+editor/indexToPositionInLine.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/matlab/codetools/+matlab/+desktop/+editor/positionInLineToIndex.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/matlab/codetools/edit.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/matlab/helptools/docsearch.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Warning: Excluded "C:/Program Files/MATLABTrial/R2023a/toolbox/matlab/helptools/help.m"; reason: The file or function is non-deployable and has been excluded from packaging. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component. Then you can suppress this warning by using the %#exclude pragma. Parsing file "D:\tmp\MIB2-2.840\mib_deploy.m" (referenced from command line). Generating file "D:\tmp\MIB2-2.840\MIB_R2023a\for_testing\readme.txt". DEMO Compiler license. The generated application will expire 30 days from today, on Fri Jun 23 09:48:08 2023.
Packaging... Creating the bundle... Creating the install agent URL file... Web based installer created at D:\tmp\MIB2-2.840\MIB_R2023a\for_redistribution\MIB_Win.exe. Packaging complete. Elapsed packaging time was: 7 minutes and 37 seconds. `
Thank you for doing great work. Lam
Dear @Ajaxels , @andreped
Thank you for producing this wonderful software. I'm trying to compile MIB2 myself. Unfortunately, this error appeared when I started compiling. (This is the first time I use Matlab to compile a program). Could you take a look and point me to some direction, please?
Thank you so much, Lam