How do I import yolov3 onnx model into MATLAB?
조회 수: 3 (최근 30일)
이전 댓글 표시
Dear Community,
I am currently trying to import a pretrained yolo image segmentation model into Matlab (R2021a, all Addons and Toolboxes installed). When I was doing it with a yolov2-network as described here, I am able to do so.
However when I try to the the same with a newer version of the classifier, provided by the ONNX Model Zoo, I receive the following error message:
modelname='yolov3-10.onnx' %downloaded and stored in current dir
lgraph = importONNXLayers(modelname,'ImportWeights',true);
Error using nnet.internal.cnn.onnx.translateONNX>getONNXImageInputSize (line 482)
Unspecified input dimensions are supported only for sequence or batch dimensions.
Error in nnet.internal.cnn.onnx.translateONNX>createInputLayer (line 464)
ONNXInputShape = getONNXImageInputSize(ONNXInputDims); % Returns [C H W]
Error in nnet.internal.cnn.onnx.translateONNX (line 59)
inputLayer = createInputLayer(thisGraph, inputsWithoutInitializers{i}, UserImageInputSize);
Error in nnet.internal.cnn.onnx.importONNXLayers (line 10)
[LayersOrGraph, translationIssues] = nnet.internal.cnn.onnx.translateONNX(modelProto, OutputLayerType, UserImageInputSize, ImportWeights);
Error in importONNXLayers (line 48)
Layers = nnet.internal.cnn.onnx.importONNXLayers(modelfile, varargin{:});
Any I idea what I could do instead?
Many thanks in advance :)
Alex
댓글 수: 0
답변 (2개)
Anshika Chaurasia
2021년 9월 17일
Hi Alexander,
The reason for error is that your model has variable input dimensions (i.e. input dimensions are not fix).
Hope it helps!
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!