模型构建过程省略,直接看下模型结构:
model.summary()
卷积中间过程可视化:
import matplotlib.pyplot as plt
import numpy as np
import random
from tensorflow.keras.preprocessing.image import img_to_array, load_img
# 定义新的模型,将原模型的中间过程当作输出
successive_outputs = [layer.output for layer in model.layers[1:]]
visualization_model = tf.keras.models.Model(inputs = model.