我已经为图像彩色化准备了一个CNN模型:
"""Encoder - Input grayscale image (L)"""
model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', padding='same', input_shape=(256, 256, 1)))
...
"""Latent space"""
model.add(Conv2D(512, (3,3), activation='relu', padding='same'))
"""Decoder - output (A,B)"""
...
model.add(Conv2D(2, (3, 3), activation='tanh', padding='same'))现在我想使用ResNet作为特征提取器,并将输出合并到潜在空间。
我已经将ResNet模型导入为:
resnet50_imagnet_model = tf.keras.applications.resnet.ResNet50(weights = "imagenet",
include_top=False,
input_shape = (256, 256, 3),
pooling='max')发布于 2021-03-22 20:03:48
编码器
"""Encoder - Input grayscale image (L)"""
encoder = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', padding='same', input_shape=(256, 256, 1)))
...解码器
decoder = """Decoder - output (A,B)"""
...使用tf.keras.Sequential()合并所有模型
comb_model = tf.keras.Sequential(
[encoder,resnet50_imagnet_model, decoder]
)https://stackoverflow.com/questions/66745509
复制相似问题