Я хочу передать mlp_net_input_shaped Shape (?, 32, 32, 1) модели ConvNN, но она всегда получает Shape (1, 32, 32, 1), поэтому это ошибка. Форма (32, 32) получается из функции matmul, вот код
# Define input placeholders for user, item and label.
user = tf.placeholder(tf.int32, shape=(None, 1))
item = tf.placeholder(tf.int32, shape=(None, 1))
label = tf.placeholder(tf.int32, shape=(None, 1))
# User embedding for MLP
mlp_u_var = tf.Variable(tf.random_normal([len(users), 32], stddev=0.05), name='mlp_user_embedding')
mlp_user_embedding = tf.nn.embedding_lookup(mlp_u_var, user)
# Item embedding for MLP
mlp_i_var = tf.Variable(tf.random_normal([len(items), 32], stddev=0.05), name='mlp_item_embedding')
mlp_item_embedding = tf.nn.embedding_lookup(mlp_i_var, item)
# Our MLP layers
mlp_user_embed = tf.keras.layers.Flatten()(mlp_user_embedding)
mlp_item_embed = tf.keras.layers.Flatten()(mlp_item_embedding)
#mlp_concat = tf.keras.layers.concatenate([mlp_user_embed, mlp_item_embed])
#Outer Product
mlp_relation = tf.matmul(tf.transpose(mlp_user_embed), mlp_item_embed)
mlp_net_input = tf.expand_dims(mlp_relation, -1)
ml_net_input_shaped = tf.reshape(mlp_relation, [-1, 32, 32, 1])