我已经在互联网上搜索了几天,试图找到一个解决这个错误的方法,但我找不到的任何东西都是特别适用的:
ValueError: Error when checking target: expected dense_2 to have shape (300,) but got array with shape (60,)
下面是生成错误的代码(数据预处理除外):
model = keras.Sequential([
keras.layers.Conv1D(5,input_shape=(1,60), kernel_size=12, padding='same'),
keras.laye
在训练我的keras模型之前,我对图像执行了以下操作:
for img in os.listdir(path):
# convert to array
img_array = cv2.imread(os.path.join(path,img) ,cv2.IMREAD_GRAYSCALE)
# resize to normalize data size
new_array = cv2.resize(img_array, (IMG_SIZE, IMG_SIZE))
# add this to our training_data list