Keras: “RuntimeError: Failed to import pydot.” after installing graphviz and pydot

后端 未结 12 1207
我在风中等你
我在风中等你 2020-12-03 04:58

I\'m using Anaconda Python 2.7 on windows 10

I was planning on doing Keras visualization so (whilst spyder was open) I opened the Anaconda command prompt and pip ins

12条回答
  •  不知归路
    2020-12-03 05:12

    The below works inside a jupyter notebook runing in a jupyter/tensorflow-notebook docker container.

    !conda install -y graphviz pydotplus
    
    import pydotplus
    import keras.utils
    keras.utils.vis_utils.pydot = pydotplus
    keras.utils.plot_model(your_model_name, to_file='model.png', show_shapes=True)
    

    You need to tell keras to use pydotplus

提交回复
热议问题