Val and test data shape:
x_train = train_data.reshape(train_data.shape[0], train_data.shape[1], train_data.shape[2], INPUT_DIMENSION)
#x_t =x_train = train_data.reshape(train_data.shape[0], train_data.shape[1], train_data.shape[2])
x_test_all = test_data.reshape(test_data.shape[0], test_data.shape[1], test_data.shape[2], INPUT_DIMENSION)
x_val = x_test_all[-VAL_SIZE:]
y_val = y_test[-VAL_SIZE:]
x_test = x_test_all[:-VAL_SIZE]
y_test = y_test[:-VAL_SIZE]
history_fdssc = model_fdssc.fit(
[x_train.reshape(x_train.shape[0], x_train.shape[1], x_train.shape[2], x_train.shape[3], 1),
x_train.reshape(x_train.shape[0], x_train.shape[1], x_train.shape[2], x_train.shape[3])], [y_train, y_train, y_train],
validation_data=(x_val.reshape(x_val.shape[0], x_val.shape[1], x_val.shape[2], x_val.shape[3], 1), y_val),
batch_size=batch_size, epochs=nb_epoch, shuffle=True,
callbacks=[early_Stopping, save_Best_Model, reduce_LR_On_Plateau, history, tensor_board])
When I run the program I am getting the following error:
Please input the name of Dataset(IN, UP, KSC or SS):KSC
(512, 614, 176)
The class numbers of the HSI data is: 13
-----Importing Setting Parameters-----
-----Starting the 1 Iteration-----
Train size: 1048
Test size: 4163
Validation size: 524
-----Selecting Small Pieces from the Original Cube Data-----
Traceback (most recent call last): File "hyb.py", line 189, in x_t =x_train = train_data.reshape(train_data.shape[0], train_data.shape[1], train_data.shape[2]) ValueError: cannot reshape array of size 14940288 into shape (1048,9,9)