超解像のディープラーニングを試みています。input imageとoutput imageのshapeは合っているのですが、Convの過程でShapeが合わずに学習が出来ません。解決策を探しております。どなたかよいアドバイスをお願いいたします。
imagelow_train=x_train.reshape(490,500, 607, 1)
imagehigh_train=y_train.reshape(490, 500, 607, 1)
#DDSRCNN
def network_ddsrcnn():
input_image=Input(shape=(None,None,1))
enc1 = Conv2D(64, kernel_size=3, activation='relu', padding='same')(input_image) enc1 = Conv2D(64, kernel_size=3, activation='relu', padding='same')(enc1) down1 = MaxPooling2D(pool_size=2)(enc1) enc2 = Conv2D(128, kernel_size=3, activation='relu', padding='same')(down1) enc2 = Conv2D(128, kernel_size=3, activation='relu', padding='same')(enc2) down2 = MaxPooling2D(pool_size=2)(enc2) enc3=Conv2D(256, kernel_size=3, activation='relu', padding='same')(down2) up3=UpSampling2D(size=2)(enc3) dec3=Conv2D(128, kernel_size=3, activation='relu', padding='same')(up3) dec3 = Conv2D(128, kernel_size=3, activation='relu', padding='same')(dec3) add2=Add()([dec3,enc2]) up2=UpSampling2D(size=2)(add2) dec2=Conv2D(64, kernel_size=3, activation='relu', padding='same')(up2) dec2 = Conv2D(64, kernel_size=3, activation='relu', padding='same')(dec2) add1=Add()([dec2,enc1]) dec1=Conv2D(1, kernel_size=5, activation='linear', padding='same')(add1) model=Model(input_image,dec1) return model
model=network_ddsrcnn()
training=model.fit(imagelow_train,imagehigh_train,epochs=100,batch_size=10,shuffle=True,validation_data=(imagelow_test,imagehigh_test),verbose=1)
エラーコード
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [10,250,302,128] vs. [10,250,303,128]
あなたの回答
tips
プレビュー