且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

具有多个元素的数组的真值是不明确的。在图像分类问题中使用a.any()或a.all()

更新时间:2021-11-27 18:02:13

请参阅@ jmetz,@ suri,您将 validation_steps 参数设置为相同的问题,因为将其初始化为(X_test)/ 32 (可能不是标量)。
检查您的 validation_steps.shape / len(validation_steps)和您的 steps_per_epoch。形状 / len(steps_per_epoch)(取决于输入尺寸)。
它们必须是标量。

Referring to @jmetz, @suri you have the same issue with your validation_steps parameter, as you initialized it to (X_test)/32(probably not a scalar). Check your validation_steps.shape / len(validation_steps) and your steps_per_epoch.shape / len(steps_per_epoch)(depending on the input dimensions). They have to be scalars.