Problem with CNN after compiling

조회 수: 8 (최근 30일)
Slavomír Duga
Slavomír Duga 2019년 3월 16일
편집: Bruno 2023년 3월 9일
Hello, I created CNN, train the network and then i tried to clasify images. Everything was good, but after I compile my figure to .exe, I'm getting this eror:"Variable 'net' originally saved as a SeriesNetwork cannot be instantiated as an object and will be read in as a uint32."
Problem is in this row: "predictedLabels = classify(net,spektrogram);"
Can anyone help pls?

답변 (1개)

Antti
Antti 2021년 1월 8일
It looks like your executable doesn't know how to handle the network object. You can try explicitly including the class definition file in your executable.
You can find the directory containing "SeriesNetwork" by executing the following command in the MATLAB command window:
>> which SeriesNetwork
It will likely look something like this:
"C:\Program Files\MATLAB\<version>\toolbox\nnet\cnn\SeriesNetwork.m"
Then you can include the directory containing the class definition using the "-a" flag for "mcc".
Your final compilation command will look something like this:
mcc -m yourApplication.m -a "C:\Program Files\MATLAB\<version>\toolbox\nnet\cnn"
  댓글 수: 1
Bruno
Bruno 2023년 3월 9일
편집: Bruno 2023년 3월 9일
I had a similar problem, but when using the Library Compiler (Python Package). Your suggestion worked for me, but it produced a 27 MB instead of 700 kB .ctf file in the end. I'm wondering if there's an alternative way to save the output of trainNetwork and load it from a compiled file (e.g., .ctf as a Python package).

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by