Error with CNN and RNN network

4 visualizzazioni (ultimi 30 giorni)
Darrien Walters
Darrien Walters il 3 Dic 2020
Commentato: Asiya Al-Busaidi il 22 Lug 2021
I am using a CNN and RNN together in matlab i believe my layers are connected properly. The problem i get is when i try to train my network using trainNetwork i get an error stating:
"Error using trainNetwork (line 183)
Invalid training data. For a recurrent layer with output mode 'last', inputs must be cell arrays."
I belive it is to do with my input but I am unsure what how to fix it. The input train input is a 4D double from this error should it be in a different format?
  1 Commento
Asiya Al-Busaidi
Asiya Al-Busaidi il 22 Lug 2021
Did you manage to solve this issue?
I have YTrain as catagorial array but still getting the same error msg.

Accedi per commentare.

Risposte (1)

Abhishek Gupta
Abhishek Gupta il 22 Dic 2020
Hi,
According to the error, you need to input cell array datatype to your network. This is because the recurrent layer with output mode 'last' in your network only takes the input of datatype cell arrays.
You can use num2cell() function to convert a double array to a cell array.

Community Treasure Hunt

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

Start Hunting!

Translated by