verivital / nnv

Neural Network Verification Software Tool
http://www.verivital.com
111 stars 49 forks source link

error when running -nodesktop/-nodisplay importONNXNetwork #161

Closed mldiego closed 2 months ago

mldiego commented 1 year ago

I am running the CAV23 repeatability files and run into the following error:

Error using matlab.internal.indentcodeLegacy
This feature is not supported because:
Swing is not currently available.

Error in indentcode (line 42)
        indentedText = matlab.internal.indentcodeLegacy(text, language);

Error in nnet.internal.cnn.onnx.fcn.ModelTranslation/genOutputFcn (line 100)
            code = indentcode(code);                                                    % Indent the code

Error in nnet.internal.cnn.onnx.fcn.ModelTranslation (line 39)
            this.ModelFunctionCode        = genOutputFcn(this, outputFcnName, this.ToplevelGraphTranslation, isGeneratingCustomLayerOPTIONAL);

Error in nnet.internal.cnn.onnx.CustomLayerManager/genCustomLayerFunction (line 499)
            modelTranslation = nnet.internal.cnn.onnx.fcn.ModelTranslation(modelProto, modelFcnPath, modelFcnName, maxNameLength, true);

Error in nnet.internal.cnn.onnx.CustomLayerManager (line 77)
                this.ModelTranslations(i) = genCustomLayerFunction(this, this.ModelProtos(i), nameStem);

Error in nnet.internal.cnn.onnx.ModelTranslationIntoLayers (line 228)
                this.CustomLayerManager = nnet.internal.cnn.onnx.CustomLayerManager(this.GraphProtoManager, ...

Error in nnet.internal.cnn.onnx.importONNXNetwork (line 32)
modelTranslationIntoLayers = nnet.internal.cnn.onnx.ModelTranslationIntoLayers(modelProto, ...

Error in importONNXNetwork (line 113)
Network = nnet.internal.cnn.onnx.importONNXNetwork(modelfile, varargin{:});

Error in load_rl_NNs (line 12)
            net = importONNXNetwork(benchmarkFolder+string(listNN(h).name), InputDataFormats="BC");

We should contact Mathworks, this could be a bug on the ModelTranslation/genOutputFcn function that could be avoided. For now, I could not find any good solution to this, so just save them in MATLAB's format and use those in the docker container.

mldiego commented 1 year ago

This is a MATLAB problem when running without GUI, will close it when it gets fixed.

mldiego commented 2 months ago

In newer versions of MATLAB, this is not a problem anymore (R2023B and newer)