【发布时间】:2017-04-25 16:10:12
【问题描述】:
我目前正在生成一个data_generate(batch_size),它包含
batch_size 作为参数。
我的网络是多输入网络,有33个输入,形状为(45,8,3)
如果批量大小 = 1,那么我可以轻松地将输入数据生成为 [33 inputs],但是当批量大小变为 > 1 时,我不确定应该如何格式化输入数据。
这样做[[33 inputs], [33 inputs], [33 inputs] , [33 inputs], .. ,[33 inputs] ] 似乎不起作用,因为 keras 期望列表中的第一个条目是 numpy.ndarray,在本例中是 numpy ndarray 列表。
我可以给它一个形状为 (33,45,8,3) 的 numpy 数组列表,比如[(33,45,8,3),(33,45,8,3),(33,45,8,3),....,(33,45,8,3)]
但是当我用 2 测试时这会导致这个错误:
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 33 arrays but instead got the following list of 2 arrays: [array([[[[ 3., 4., 4.],
那么想要的输入格式是什么?
【问题讨论】: