'Layer 1' is not a valid model name because it is not a valid MATLAB function name

149 views (last 30 days)
What does it mean is not a valid MATLAB function name? When I first generated a neural network with matlab 'Layer 1' name was autogenerated. How can i resolve this ? If I rename somehow the block name is enough or this may mean something else too?
Thanks in advance,
M

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 29 Apr 2019
Edited: Fangjun Jiang on 29 Apr 2019
remove the white space. call it "Layer1" or "Layer_1"
  13 Comments
mar gian
mar gian on 4 May 2019
"Perhaps you are attempting to somehow invoke a layer directly as-if it were a model? For example you cannot open_system() a block directly: you have to open_system() the block qualified by the model name"
Yes, I went through the code again and I found out that I had done this exact thing...
And even I renamed the block when autogenerated it kept showing errors. Anyway I changed that and now works fine.
MANY THANKS to both of you who responded and spend some amount of time !!!!!

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning with GPU Coder in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!