首页 > 解决方案 > 检查模型输入时出错:预计会看到 290 个数组,但得到了以下 1 个数组的列表

问题描述

我试图用 290 个输入数组训练一个 NN。为了实现这一点,我以这种方式创建了输入:

inputs = []
for i in range(0,288):
    inputs.append(Input(shape=(6,), name='input'+str(i)))

efic_ener = Input(shape=(1,))
poten_instal = Input(shape=(1,))
inputs.append(efic_ener)
inputs.append(poten_instal)

所以最后我有一个 290 个数组的列表。输入数据已经过预处理以获得该维度,但它在一个列表中,所以当我尝试训练 NN 时,我得到了错误:

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 290 array(s), but instead got the following list of 1 arrays:

由于数据在列表中。你知道克服这个问题的方法吗?泰

PS:我已经看到我可以一个一个地创建那些 290 个数组,我试图跳过它:P

标签: pythontensorflowinputkeras

解决方案


推荐阅读