coder.load​DeepNeural​Network: ??? Expected a character vector

조회 수: 2 (최근 30일)
Matthias Kreuzer
Matthias Kreuzer 2022년 12월 23일
댓글: Hariprasad Ravishankar 2023년 1월 10일
I am trying to use matlab coder to generate mex functions for a DAGNetwork type.
I use the following minimum example as suggested in the Matlab Documentation:
function out = myNet_predict(in) %#codegen
persistent mynet;
if isempty(mynet)
mynet = coder.loadDeepLearningNetwork('matlab.mat');
end
out = predict(mynet,in);
If matlab.mat contains the pre-trained resnet50, everything fine. However, if use a custom DAGNetwork, Matlab Coder throws throws the following error: ??? Expected a character vector. Did someone else encounter this problem and knows how to fix this issue?

답변 (1개)

Hariprasad Ravishankar
Hariprasad Ravishankar 2022년 12월 23일
Is it possible that the filename of the custom DAGNetwork has non-ASCII characters? If so, can you try removing any path with such characters and retry?
If you still see the issue, would it be possible to share an example that reproduces the issue?
Hari
  댓글 수: 4
Matthias Kreuzer
Matthias Kreuzer 2023년 1월 10일
I have a trained a resnet50 model using pytorch saved it in Onnx format and imported the model to MATLAB as a DAGNetwork. The matlab coder does not give any errors, when I load the resnet model that is provided by Matlab, only the imported version causes this error.
Hariprasad Ravishankar
Hariprasad Ravishankar 2023년 1월 10일
I see. Is it possible to disp the network to see if the layer names or the class label names might have unsupported character (non-ASCII) types?
If your license provides access to our technical support team, you can reach out to them to share the network with us.
Alternatively, you can try to isolate the source of the problem by creating a smaller network from a subgraph of the original network, that reproduces the issue. The deepNetworkDesigner may be helpful here.

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

카테고리

Help CenterFile Exchange에서 Deep Learning Code Generation Fundamentals에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by