silly error in trainnet network design

조회 수: 3 (최근 30일)
Raf
Raf 2024년 9월 11일
편집: Drew 2024년 9월 11일
received following errors - for seemingly straight forward command:
> net = trainnet(data1, class1, net_1, "crossentropy", options);
Error Number of observations in predictors (1) and targets (1071) must match.
Check that the data and network are consistent.
This is odd because both the training and validation data/class are matching size 1071 X 140 and 1071 X 1. Could you please advise. Similarly validation in options have compatiable digmensions. weird.

채택된 답변

Drew
Drew 2024년 9월 11일
편집: Drew 2024년 9월 11일
The error message indicates that there is just one (1) observation, but 1071 targets. Check the data type and size of the inputs. See the doc https://www.mathworks.com/help/deeplearning/ref/trainnet.html for details about the several types of data that can be input, and for options like "InputDataFormats" which can affect the interpretation of the inputs.
If this answer helps you, please remember to accept the answer.
  댓글 수: 2
Raf
Raf 2024년 9월 11일
spot on, been a while, data was entered as matrices, converted to cells working like a champ. Thanks. RA
Drew
Drew 2024년 9월 11일
I'm glad to hear that it is working now. I see there is an upvote on the answer, but it looks like you have not accepted the answer. Do you see the button to accept the answer?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by