У меня просто были проблемы с созданием сети, и я не могу получить входные данные, форма тензоров такая же, как мне нужна в моем проекте. Но я продолжаю получать эту ошибку. ValueError: Ошибка при проверке входных данных модели: список Numpy массивов, передаваемых в вашу модель, отличается от ожидаемого размера модели. Ожидается увидеть 2 массива (ов) для входов ['input_1', 'input_2'], но вместо этого получит следующий список из 1 массивов: [array ([[[[[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],
[[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]],
Вот мой код
x1_train = [[[[0, 0, 0],[0, 0, 0],[0, 0, 0]],[[0, 0, 0],[0, 0, 0],[0, 0, 0]],[[0, 0, 0],[0, 0, 0],[0, 0, 0]]],[[[0, 0, 0],[0, 0, 0],[0, 0, 0]],[[0, 0, 0],[0, 0, 0],[0, 0, 0]],[[0, 0, 0],[0, 0, 0],[0, 0, 0]]]]
y_train = [[0.3]]
# define two sets of inputs
inputA = tf.keras.Input(shape=(3,3,3))
inputB = tf.keras.Input(shape=(3,3,3))
# the first branch operates on the first input
x = tf.keras.layers.Dense(8, activation="relu")(inputA)
x = tf.keras.layers.Dense(4, activation="relu")(x)
x = tf.keras.Model(inputs=inputA, outputs=x)
# the second branch opreates on the second input
y = tf.keras.layers.Dense(64, activation="relu")(inputB)
y = tf.keras.layers.Dense(32, activation="relu")(y)
y = tf.keras.layers.Dense(4, activation="relu")(y)
y = tf.keras.Model(inputs=inputB, outputs=y)
# combine the output of the two branches
combined = tf.keras.layers.concatenate([x.output, y.output])
# apply a FC layer and then a regression prediction on the
# combined outputs
z = tf.keras.layers.Dense(2, activation="relu")(combined)
z = tf.keras.layers.Dense(1, activation="sigmoid")(z)
# our model will accept the inputs of the two branches and
# then output a single value
model = tf.keras.models.Model(inputs=[x.input, y.input], outputs=z)
model.compile(optimizer='adam',
loss='mean_absolute_percentage_error', #mean_absolute_percentage_error
metrics=['accuracy'])
model.fit(x=[x_train, x1_train], y=y_train, epochs = 1)````
I get the error message
ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 2 array(s), for inputs ['input_1', 'input_2'] but instead got the following list of 1 arrays: