Ask Your Question
4

How can the compatibility issue between input 0 and the layer be resolved if the expected ndim=3 while ndim=2 was found and the full shape received was (None, 3002832)?

asked 2021-08-04 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-12-26 04:00:00 +0000

djk gravatar image

There are several ways to resolve the compatibility issue between input 0 and the layer, such as:

  1. Reshape the input: If the input has ndim=2, it can be reshaped to have ndim=3 by adding a new dimension. For example, if the input shape is (batchsize, numfeatures), it can be reshaped to (batchsize, 1, numfeatures).

  2. Add a new layer: If the input cannot be reshaped, a new layer can be added to the model to transform it to the desired shape. For example, a Reshape layer can be added to reshape the input to the desired shape.

  3. Change the input shape: If the expected ndim is actually 2, the input shape can be changed to match the expected shape. For example, if the expected input shape is (batchsize, numfeatures), the input can be reshaped to (batchsize*numfeatures,) or (numfeatures, batchsize).

  4. Change the layer: If the layer expects a different input shape, it can be modified to accept the input shape. For example, if the layer expects ndim=3 but only needs the last dimension, it can be modified to accept ndim=2 and take the last dimension as input.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-08-04 11:00:00 +0000

Seen: 11 times

Last updated: Dec 26 '21