我有一个VGG预训练模型。我将形状(160120,3)的图像传递给它,批量大小为10。批处理中的每个帧表示一个时间步长。
vggnet.output.shape
(None,5,3,512)
接下来,我想把这个输出从VGGnet输入到ConvLSTM2D层。但是为了这个,我需要把它转换成一个5D张量。
当我使用
X = tf.keras.layers.Reshape((-1,10,5,3,512))(X)
,训练时出错。
InvalidArgumentError: Input to reshape is a tensor with 76800 values, but the requested shape has 768000
[[node ds_model/reshape_2/Reshape (defined at <ipython-input-40-4fa9476bf8a0>:1) ]] [Op:__inference_train_function_5897]
Function call stack:
train_function
如何解决此错误?有没有什么方法可以把4D张量重塑成5D??
我想改变信仰
(None,10,5,3,512)