Error using trainNetwork (line 184)
显示 更早的评论
Hi All,
I am trying to classify sequence datasets using deep learning by applying
net = trainNetwork(XTraining,YTraining,layers,options);
where
K>> whos XTraining
Name Size Bytes Class Attributes
XTraining 6586x1 63910544 cell
K>> whos YTraining
Name Size Bytes Class Attributes
YTraining 6586x1 9598 categorical
but I am getting the following error
Error using trainNetwork (line 184)
Out of range subscript.
Caused by:
Error using sub2ind (line 43)
Out of range subscript.
I don't get why I get the out of range subscript error since XTraining & YTraining are both 6586x1.
However if I try
net = trainNetwork(XTraining(1:4000),YTraining(1:4000),layers,options);
it works well but not for any ranges above 4000 :|
Can someone please let me know what's going on and how I can solve this issue?
回答(1 个)
Walter Roberson
2022-3-18
0 个投票
What would happen if one of the layers requested an array larger than the size stored in your cells, XTraining{1} and so on?
In particular if it fails for values above 4000 check that XTraining{4001} is the same size as XTraining{1}
13 个评论
Susan
2022-3-18
Walter Roberson
2022-3-21
Not at the moment. If you post your code and data then I might be able to get further, perhaps.
Susan
2022-3-21
Walter Roberson
2022-3-21
Google Drive ?
Susan
2022-3-21
Susan
2022-3-21
Emma Jakobsson
2022-4-6
编辑:Emma Jakobsson
2022-4-6
I solved it too
Ratri M
2022-4-7
I am getting same problem too, would you mind telling what was your solution?
Juan Leal
2022-5-14
Hi, could you please explain how you solved this issue? I am also having the same problem.
Vinay Kulkarni
2023-4-4
Facing same issue. Can you please help on how you solved it.
Susan
2023-4-4
Vinay Kulkarni
2023-4-5
I too had made mistake in number of classes. Once that corrected the training started.
类别
在 帮助中心 和 File Exchange 中查找有关 Language Support 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!