x_train, x_validate, y_train, y_validate = train_test_split(x_train, y_train, test_size = 0.1, random_state = 999) ## Reshape image in 3 dimensions (height = 100, width = 125 , canal = 3) x_train = x_train.reshape(x_train.shape[0], *(224, 224, 3)) x_test = x_test.reshape(x_test.shape[0], *(224, 224, 3)) x_validate = x_validate.reshape(x_validate.shape[0], *(224, 224, 3))代码段报错 ValueError: cannot reshape array of size 162675000 into shape (4338,224,224,3)
时间: 2023-12-24 21:25:47 浏览: 33
这个错误提示表明你试图将一个大小为 162675000 的数组重新塑形为 (4338, 224, 224, 3),但这是不可能的。可能原因是你的输入数据尺寸不正确,或者是你的代码存在错误。建议你检查代码中的变量和数组的尺寸,确保它们符合你的预期。你可以使用print语句来打印变量的尺寸和值,以便更好地了解代码的执行过程。
阅读全文