I am getting "Swing is not available error"

조회 수: 9 (최근 30일)
Gourav
Gourav 2024년 7월 21일
편집: Ayush Modi 2024년 7월 21일
I am trying to import a model. But when using importONNXNetwork function I am getting the following error:
Error using matlab.internal.indentcodeLegacy
This feature is not supported because:
Swing is not currently available.
Can anybody help me ?

답변 (1개)

Ayush Modi
Ayush Modi 2024년 7월 21일
편집: Ayush Modi 2024년 7월 21일
Hi Gourav,
This is an bug with "importONNXNetwork" function. As a workaround, you can follow the below steps:
       1.   Run MATLAB desktop using the GUI.
       2.   Edit a file to remove the call to “indentcode” in MATLAB using the following command in MATLAB command window:    
>>edit nnet.internal.cnn.onnx.fcn.ModelTranslation
  Search for the call to “indentcode” and remove or comment out the line in the code containing the function call.
code = nnet.internal.cnn.onnx.util.indentcode(code);
       3.   Edit another file to remove the call to “indentcode” in MATLAB using the following command in MATLAB command window:   
>>edit nnet.internal.cnn.onnx.CustomLayerManager
  Search for “indentcode” and make the following change: 
Original code:
classdefCode = string(indentcode(char(join(classdefCode'newline))))
Modified code:
classdefCode = string(char(join(classdefCode',newline));
       4.   Write an identity function in your local directory to override the “indentcode” function.    
function X = indentcode(X)
end
Note - This issue was solved in MATLAB R2024a version.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by