ValueError: The two structures don't have the same sequence length. Input structure has length 14, while shallow structure has length 10

Viewed 896

https://github.com/Yuanbo2020/Audio-Visual-VAD/tree/main/Code/framework In the process of reproducing an open source code, I came across this question, and i did not find solution to solve it. I used keras2.4.3 with tf2.30 as backend. Since the open source code did not have code with data processing, i did this as i understand with the paper and code. It is a multioutput network, I tried to check the input of the network, x contains audio with(N,15,64,3) and video with (N,450,300,3), y contains 14 tensors with shape of (N,1).

2 Answers

After almost 2 hours debug, I find that the key point is that when calculating loss, because it is a multiple output network, i use 10 loss function, and the input of label with 14 tensors with shape of (N,1), it is why it happens: "Input structure has length 14, while shallow structure has length 10." . When you come across this question, please check carefully the input shape of feature and label, the output shape of network.

Try using Tensorflow==2.2.0 and Keras==2.3.1 as they didn't produce errors like this

Related