python - 检查模型输入时出错:预计会看到 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
解决方案
推荐阅读
- php - 方法 Illuminate\Database\Eloquent\Collection::books 不存在。(laravel)
- python - 与 Python set() 混淆
- docker - 如何在 docker run 中将命令行参数作为环境变量传递?
- angular - Websphere 应用程序服务器中的 Angular 项目(dist 文件夹)部署
- java - 如何在目录选择器中添加内部和 SD 卡存储路径?
- c# - 如何声明只能由另一个控制器函数访问的控制器函数并防止直接访问(.NET Core)
- angular - 同一页面角度材料中的多个日期选择器(角度材料8.2.3)
- ruby-on-rails - 在 Rails 应用程序中的何处放置无限轮询 ruby 服务?
- discord.js - 留言 discord.js v12
- arrays - 如何实现 Ruby max_by 以返回所有具有最大值的元素?