Tensorflow - model.fit выдает InvalidArgumentError - PullRequest
0 голосов
/ 09 марта 2020

Пожалуйста, помогите мне решить следующую ошибку.

Версия Tensorflow: 2.x

Python: 3.7.4

InvalidArgumentError: model.fit выдает следующую ошибку:

InvalidArgumentError: Cannot update variable with shape [] using a Tensor with shape [512], shapes must be equal.
     [[{{node metrics_12/accuracy/AssignAddVariableOp}}]]

Окончательная модель:

inputs = [input_text1, input_text2]
outputs = score_oq_oa
model = Model(inputs=inputs, outputs=outputs)

model.summary()

enter image description here

model.compile(optimizer='adam',loss='binary_crossentropy',metrics=['accuracy'])
history = model.fit([padded_query_train,padded_answer_train], [y_train],
                    batch_size=512,epochs=5,validation_split=0.2)

Ожидается Архитектура модели:

enter image description here

...