Python Numpy和keras张量大小混淆
无论我做什么改变,Python Numpy和keras张量大小混淆,python,numpy,keras,Python,Numpy,Keras,无论我做什么改变,densite\u输入总是想要“(无,296)”。错误是: ValueError: Error when checking model input: expected dense_1_input to have shape (None, 296) but got array with shape (296, 1) ` 代码: 通过以下方式更改myGenerator()函数: result = result.reshape(1, 296) 因此,整形操作符的结果将被保存
densite\u输入总是想要“(无,296)”。错误是:
ValueError: Error when checking model input: expected dense_1_input to have shape (None, 296) but got array with shape (296, 1) `
代码:
通过以下方式更改myGenerator()
函数:
result = result.reshape(1, 296)
因此,整形操作符的结果将被保存。整形
不起作用,因此当您执行结果时。整形(1296)
您实际上并没有修改结果
。试试result=result。重塑(1296)
,它会解决你的问题
result = result.reshape(1, 296)