我正在试着把我模型中的第一层可视化,但是我不确定我是否能做到,你能帮忙吗?
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Dense, Flatten, Dropout
model = Sequential()
model.add(Conv2D(16, (3,3), 1, activation='relu', input_shape=(256,256,3)))
model.add(MaxPooling2D())
model.add(Conv2D(32, (3,3), 1, activation='relu'))
model.add(MaxPooling2D())
model.add(Conv2D(16, (3,3), 1, activation='relu'))
model.add(MaxPooling2D())
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile('adam', loss=tf.losses.BinaryCrossentropy(), metrics=['accuracy'])
model. Summary(
)
1条答案
按热度按时间to94eoyn1#
您可以使用
plot_model
来显示模型。您不能仅直接显示第一个图层https://www.tensorflow.org/tensorboard/get_started,Tensorboard也可以帮助您