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 105375000 into shape (2810,224,224,3)如何解决
时间: 2023-12-13 13:04:12 浏览: 143
train_and_test_digits.zip
这个错误的原因是你试图将一个大小为105375000的数组重新塑造为(2810,224,224,3)的形状,这是不可能的。你需要检查一下你的输入数据x_train是否正确。可能是你的输入数据x_train的形状不正确或者大小不正确,导致了这个错误。你可以使用print语句打印x_train的形状和大小,以便找到问题所在。通常情况下,这种错误可能是由于输入数据的形状和大小不匹配导致的。
阅读全文