Python 加载保存的模型时出现不同的体系结构问题

Python 加载保存的模型时出现不同的体系结构问题,python,machine-learning,keras,deep-learning,data-science,Python,Machine Learning,Keras,Deep Learning,Data Science,使用以下方法培训我的模型: 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) #

使用以下方法培训我的模型:

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, ...,