필터 지우기
필터 지우기

Standalone Compiler Load ImageDataStore

조회 수: 2 (최근 30일)
patmen346
patmen346 2022년 11월 7일
댓글: patmen346 2022년 11월 9일
Hi everyone I am struggeling with the Compiler Toolbox. I want to run a function in a standalone app, which simply loads a available IMDS mat-file and train a network for this. Unfortunately, it crashs in the compiled version with the following error message:
Warning: While loading an object of class 'matlab.io.datastore.ImageDatastore':
Cannot access 'getFiles' in class 'matlab.io.datastore.FileSet'.
Message: Cannot access 'getFileSizes' in class 'matlab.io.datastore.FileSet'.
Identifier: MATLAB:datastoreio:dsfileset:parensNotAllowed
In file: C:\Program Files\FraunhoferIFF\MATLAB Runtime\v99\mcr\toolbox\matlab\datastoreio\+matlab\+io\+datastore\@ImageDatastore\ImageDatastore.m
line: 442
It works in Matlab itself, but not with the compiled standalone application.

답변 (1개)

Steven Lord
Steven Lord 2022년 11월 7일
See the first Tip on this documentation page. If there's no reference in the code itself that tells MATLAB Compiler it needs to include the imageDatastore class in your application when it analyzes your code you will need to explicitly state that MATLAB Compiler needs to include it. Use the -a argument when you call mcc or the %#function pragma (which I would put on the line before or the line after the load call in your code) to explicitly inform MATLAB Compiler that it needs to include the class.
  댓글 수: 1
patmen346
patmen346 2022년 11월 9일
Hi Steven, thanks for your help! The imageDatastore class is already in the MATLAB path and should be included. If I try to add it via both method, it doesn't solve the problem. Nevertheless, I've figured out that my batch code on Windows was using an older version of MATLAB (2020b). Both MATLAB's were in the system path variable and it seems that the older version was used via the batch script calling 'matlab'. The issue is solved by deleting the older MATLAB from system path and using the 2022b version!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Package MATLAB Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by