Skip to content Skip to sidebar Skip to footer

Shape Must Be Rank 2 But Is Rank 3 For 'matmul_46' (op: 'matmul') With Input Shapes: [100,100], [?,15,100]

I got that error when trying to implement this lines of code Shape must be rank 2 but is rank 3 for 'MatMul_46' (op: 'MatMul') with input shapes: [100,100], [?,15,100]. Q = tf.plac

Solution 1:

To modify a tensor to fit a certain shape you can use tf.reshape, but be careful to reshape it in a way that makes sense.

See the documentation

reshape = tf.reshape(word_level, [-1, 100])
Wb = tf.Variable(tf.zeros([100, 100]))
C = tf.matmul(reshape ,Wb)

Post a Comment for "Shape Must Be Rank 2 But Is Rank 3 For 'matmul_46' (op: 'matmul') With Input Shapes: [100,100], [?,15,100]"