반응형
tf.keras.utils.plot_model(model,to_file='model.png', show_shapes=True,show_layer_names=False)

모델을 시각화 하는 방법 중에 plot_model()을 이용하는 방법이 있다.

 

plot_model(show_shapes=True, show_layer_names=False) 예시

이런식으로 결과가 나와서 파일로 저장할 수 있다.

 

실행시키는 과정에서 pydot과 graphviz를 install 해줬음에도 불구하고

 

'Failed to import pydot. You must `pip install pydot` and install graphviz ...

이라는 에러메세지가 계속해서 발생했다.

 

찾아보니,

pydotplus 도 같이 install 해주면 된다고해 깔아주니 작동 했다. 

 

In addition to pydot and graphviz install pydotplus. This should solve your problem.

pip install pydot
pip install pydotplus
pip install graphviz

아래 순서대로 install 하라고 한다. 

  1. pydot
  2. pydotplus
  3. graphviz

 

github.com/XifengGuo/CapsNet-Keras/issues/69

 

ImportError: Failed to import `pydot`. Please install `pydot`. For example with `pip install pydot`. · Issue #69 · XifengGuo/C

from keras.utils import plot_model plot_model(model) Showing this error. ImportError: Failed to import pydot. Please install pydot. For example with pip install pydot. I installed -- (base) C:\User...

github.com

 

반응형