Проблема с другой архитектурой при загрузке сохраненной модели

#python #machine-learning #keras #deep-learning #data-science

#python #машинное обучение #keras #глубокое обучение #наука о данных

Вопрос:

Обучил мою модель, используя:

 history = model.fit(x=[train1,train2,train3,train4,train5,train6,train7,train8,train9],
          y=[y1,y2,y3,y4,y5,y6,y7,y8,y9], callbacks=callbacks,
          batch_size=100, epochs=1, verbose=1, validation_split=0.1, shuffle=False) #change batch to 10 for best results
  

Затем я сохранил веса архитектуру, используя:

 model.save('my_model.h5')
  

Я могу просто отлично загрузить модель, используя:

 new_model_2 = load_model('my_model.h5')
  

Но когда я пытаюсь предсказать:

 new_model_2.fit(x=[train1,train2,train3,train4,train5,train6,train7,train8,train9],
          y=[y1,y2,y3,y4,y5,y6,y7,y8,y9], callbacks=callbacks,
          batch_size=100, epochs=1, verbose=1, validation_split=0.1, shuffle=False)
  

Я получаю самую странную ошибку:

 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 8 array(s), but instead got the following list of 9 arrays: [array([[ 6.46234854e-27,  0.00000000e 00, -1.55096365e-24, ...,  
  

Я говорю, что это самое странное, потому что, когда я печатаю сводку модели, она показывает архитектуру, похожую на мою модель.
Кроме того, когда я попытался удалить y9 и train9, ошибка изменилась на:

 new_model_2.fit(x=[train1,train2,train3,train4,train5,train6,train7,train8],
          y=[y1,y2,y3,y4,y5,y6,y7,y8], callbacks=callbacks,
          batch_size=100, epochs=1, verbose=1, validation_split=0.1, shuffle=False)

ValueError: Error when checking model target: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 9 array(s), but instead got the following list of 8 arrays: [array([[-3.23117427e-27,  0.00000000e 00, -1.55096365e-24, ...,