Unable to perform assignment because the size of the left side is 2-by-1 and the size of the right side is 2-by-226.

조회 수: 1 (최근 30일)
Hi,
I am having problem solving this problem:
Unable to perform assignment because the size of the left side is 2-by-1 and the size of the right
side is 2-by-226.
Here are some parts of the code:
xTrain is a 1x226 Matrix
expectedOutputTrain is a 226x1 Matrix
size of numclasses is 2
inputSize = numel(xTrain);
numHiddenUnits = 5;
numClasses = numel(categories(expectedOutputTrain));
net = trainNetwork(xTrain',expectedOutputTrain,layers,options);
  댓글 수: 2
Stephen23
Stephen23 2018년 4월 27일
@L: please show the complete error message. This means all of the red text.
L
L 2018년 4월 27일
Hi, these are all the red text. I apologize for the inconvenience.
Error using trainNetwork (line 154)
Unable to perform assignment because the size of the left side is 2-by-1 and the size of the right side is 2-by-226.
Error in botImTired (line 54)
net = trainNetwork(xTrain,expectedOutputTrain,layers,options);
Caused by:
Unable to perform assignment because the size of the left side is 2-by-1 and the size of the right side is 2-by-226.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by