【发布时间】:2020-09-23 06:43:04
【问题描述】:
验证和测试数据形状:
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])
当我运行程序时,我收到以下错误:
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(最近一次调用最后一次): 文件“hyb.py”,第 189 行,在 x_t =x_train = train_data.reshape(train_data.shape[0], train_data.shape[1], train_data.shape[2]) ValueError: 无法将大小为 14940288 的数组重塑为 (1048,9,9)
【问题讨论】:
标签: python tensorflow image-processing reshape conv-neural-network