pip install pydot
sudo apt-get install graphviz (pip install graphviz 하면 안됨)
python 코드
from keras.utils import plot_model
plot_model(model, to_file='model.png') # 연결 구조 출력
plot_model(Focal_Loss, to_file='model_detail.png', show_shapes=True, show_layer_names=True) # input/output shape 까지 출력
아래는 keras.io 내용
plot_model
keras.utils.plot_model(model, to_file='model.png', show_shapes=False, show_layer_names=True, rankdir='TB')
Converts a Keras model to dot format and save to a file.
Arguments
- model: A Keras model instance
- to_file: File name of the plot image.
- show_shapes: whether to display shape information.
- show_layer_names: whether to display layer names.
- rankdir:
rankdir
argument passed to PyDot, a string specifying the format of the plot: 'TB' creates a vertical plot; 'LR' creates a horizontal plot.
'실습 > keras' 카테고리의 다른 글
loss weight 추가하기 및 학습 도중 loss weight 바꾸기 (1) | 2018.01.13 |
---|---|
merge (0) | 2017.01.23 |
Theano tensor (0) | 2017.01.21 |
theano.shared(value=W_values, name='W', borrow=True) (0) | 2017.01.21 |
theano.config.floatX (0) | 2017.01.21 |