神经网络架构图怎么画?

 使用Python库自动生成架构图:

from tensorflow.keras.utils import plot_model
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense

model = Sequential([
Conv2D(32, (3,3), activation='relu', input_shape=(224,224,3)),
MaxPooling2D(2,2),
Conv2D(64, (3,3), activation='relu'),
Flatten(),
Dense(10, activation='softmax')
])

plot_model(model, to_file='cnn.png', show_shapes=True)

posted @ 2025-05-29 11:39  敲出未来,未来可期  阅读(17)  评论(0)    收藏  举报