При обучении автоэнкодера с использованием Keras в Python 3.7 генерируется чужой блок кода ошибки.
[IPKernelApp] WARNING | No such comm: 65009a6a88cb11eabebf71a298ce434a
[IPKernelApp] WARNING | No such comm: 65009a6a88cb11eabebf71a298ce434a
[IPKernelApp] WARNING | No such comm: 65009a6a88cb11eabebf71a298ce434a
Кодовый блок, который генерирует ошибку, показан ниже. Когда я выполняю сценарий, модель начинает тренироваться и останавливается через несколько раз. Сбой кернала и сообщение об ошибке выводится на консоль
def build_model(lr):
main_input = Input(shape=(WIN_SIZE,WIN_SIZE,N_CHANNELS), dtype='float32', name='POI_HOOD')
# A convolutional layer will transform the vector neighborhood into a feature layer
# 64 filters (number of output filters in convolution)
# 3x3 kernel size
x = Conv2D(128, (120,120), input_shape=(WIN_SIZE,WIN_SIZE,N_CHANNELS), padding='same', activation='relu')(main_input)
pool1 = MaxPooling2D(pool_size=(2, 2))(x) #14 x 14 x 32
conv2 = Conv2D(64, (3, 3), activation='relu', padding='same')(pool1) #14 x 14 x 64
pool2 = MaxPooling2D(pool_size=(2, 2))(conv2) #7 x 7 x 64
conv3 = Conv2D(128, (3, 3), activation='relu', padding='same')(pool2) #7 x 7 x 128 (small and thick)
#decoder
conv4 = Conv2D(128, (3, 3), activation='relu', padding='same')(conv3) #7 x 7 x 128
up1 = UpSampling2D((2,2))(conv4) # 14 x 14 x 128
conv5 = Conv2D(64, (3, 3), activation='relu', padding='same')(up1) # 14 x 14 x 64
up2 = UpSampling2D((2,2))(conv5) # 28 x 28 x 64
decoded = Conv2D(1, (3, 3), activation='sigmoid', padding='same')(up2,)
model = Model(inputs = main_input, outputs = decoded)
#adam = optimizers.Adam(learning_rate=0.01, beta_1=0.9, beta_2=0.999, amsgrad=False)
opt = SGD(lr=lr, momentum = 0.9)
model.compile(optimizer=opt, loss='mean_squared_error' ,metrics =['accuracy'])
return(model)
lr= 0.0001
model = build_model(lr)
model.summary()
epochs = 1
hist = model.fit(x_train_stacked,y_train_stacked, validation_data = (x_test, y_test),epochs=epochs, batch_size=1)