Я пытался реализовать простую архитектуру
def conv_block_A(layer):
block = tf.keras.layers.Conv2D(filters=128, kernel_size=3, strides=1, padding='same')(layer)
block = tf.keras.layers.Conv2D(filters=196, kernel_size=3, strides=1, padding='same')(block)
block = tf.keras.layers.Conv2D(filters=128, kernel_size=3, strides=1, padding='same')(block)
block = tf.keras.layers.BatchNormalization(momentum=0.8)(block)
block = tf.keras.layers.LeakyReLU(alpha=0.2)(block)
return block
def PoolingAndDense(input):
dense = tf.keras.layers.GlobalAveragePooling2D(data_format='channels_last')(input)
dense = tf.keras.layers.Dense(units=64)(dense)
dense = tf.keras.layers.LeakyReLU(alpha=0.2)(dense)
dense = tf.keras.layers.Dense(units=32)(dense)
dense = tf.keras.layers.LeakyReLU(alpha=0.2)(dense)
dense = tf.keras.layers.Dense(units=1)(dense)
dense = tf.keras.activations.sigmoid(dense)
return dense
input_shape = input_shape
input_layer = tf.keras.layers.Input(shape=input_shape,dtype="float32")
stem = tf.keras.layers.Conv2D(filters=64, kernel_size=5, strides=1, padding='same')(input_layer)
first_conv_block_output = conv_block_A(stem)
mtss = PoolingAndDense(first_conv_block_output)
Model = tf.keras.Model(inputs=input_layer, outputs=mtss)
, но model.save не работает для tenorflow 1.14, но работает для 1.15, как мне заставить его работать для 1.14?