ML error: Index in position 2 exceeds array bounds (must not exceed 1).

1 回表示 (過去 30 日間)
CSCh
CSCh 2021 年 2 月 18 日
コメント済み: CSCh 2021 年 2 月 23 日
Hi all,
i got this error for my machine leraning code.
X and y are single vectors with the same length (1x35000000) .It happend after Epoche end time (1000).
Any ideas?
Thank you.
net = fitnet([5 2],'trainlm');
% Train the Network
[net,tr] = train(net,X,y);
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 18 日
When I tried to reproduce the error, I did not face any issues with sample data (0-1) of the same size
CSCh
CSCh 2021 年 2 月 23 日
Thank you also Kaylan, with your comment, I investigate other parts of my code, where the failure came from.
Thank you.

サインインしてコメントする。

回答 (1 件)

Shashank Gupta
Shashank Gupta 2021 年 2 月 22 日
Hi Christian,
I am not able to reproduce the error. I took a sample data of same size as you mentioned and I am able to train the model for more than 100 epoch. You may want to share your data with me so I can investigate it. Although looking at the error I can guess this has to do with some row or column vector confusion. May be you are trying to access a row vector but which was actually defined as column vector. In short this kind of errors just mean you are trying to access an element which does not exist.
I hope this helps.
Cheers.
  1 件のコメント
CSCh
CSCh 2021 年 2 月 23 日
Hi Shashank, thank you so much for your quick reply. Indeed, you are right,
the error steems from another part of my code. My suggestion that it came from the training part war wrong. I changed several parts in my code that brings up the confusion.
Again, many thanks.
BR

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by