problem description
what happened was, when I was happily building a model with Keras
, I found that there was an official function for drawing the model plot_model()
, so I happily called the function keras.utils.plot_model(model, 'model.png', show_shapes=True)
, and the result was the following error:
InvocationException: GraphViz's executables not found
...
ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
I thought, was it because I didn’t install , pydot
and graphviz
?So I happily turned on PyCharm
and loaded my virtual environment with pydot
and graphviz
, but it was still reporting an error.
then I shut myself up for a while. After I closed myself up, I went to baidu and Google to find a solution. Sure enough, many people met the same problem as me. According to the big guy [1], this is an environmental problem, the solution is to PIP install graphviz
or something, or manually download the graphviz
installation package on the official website, and then add the system environment variable Path
, such as C:\Program Files (x86)\Graphviz2.38\bin
something.
I thought this solution made sense, and I happily tried it out, and still got an error.
and then I shut myself down again and went back to looking for a solution. Some people [2] say that the order of installation is very important. First install pydot
, then install graphviz
; Someone [3] said to use keras.utils.vis_utils.plot_model
instead of keras.utils.plot_model
. In short, the feeling is not reliable.
finally, you guessed it, I uninstalled PyCharm
and pydot
in pydot
( PIP install pydot
0) in PyCharm
and pydot
) in the pydot
). Success!
then I thought about what was causing the error for a while, I tried to delete the system variable of graphviz
, but the error didn’t occur. Oh, calculate, calculate, just work!
h2> environment
- Windows 10
- Python 3.6
- TensorFlow 2.0 Beta (built-in Keras)
effect
Reference
- Rob. (August 25, 2018). Graphviz and Pydotplus not working. Retrieved from https://datascience.stackexchange.com/questions/37428/graphviz-and-pydotplus-not-working
- web_ninja. (August 26, 13). Why is pydot unable to find GraphViz’s Executables in Windows 8?Retrieved from https://stackoverflow.com/questions/18438997/why-is-pydot-unable-to-find-graphvizs-executables-in-windows-8
- XifengGuo. (November, 6, 2017). pydot issue. Retrieved from https://github.com/XifengGuo/CapsNet-Keras/issues/7
Read More:
- Graphviz. Backend. Executablenotfound: failed to execute ‘dot’ Python uses graphviz to solve drawing errors
- ExecutableNotFound: failed to execute [‘dot’, ‘-Tsvg’], make sure the Graphviz executables are on yo
- [error reported] [Python] [Matplotlib] importerror: failed to import any QT binding
- ImportError: numpy.core.multiarray failed to import
- ImportError: cannot import name ‘to_categorical‘ from ‘keras.utils‘
- Jumper notebook, import numpy, prompt “importerror: DLL load failed: unable to find the specified module”
- How to solve “import cv2 failed ImportError: DLL load fail: Cannot find the specified module” in Anaconda environment
- Make sure the graphviz executables are on your systems’ path
- Failed to install ISKernel Files,make sure you have appropriate privileges on this machine
- When VS code imported Cv2, an error ImportError: numpy.core.multiarray failed to import; There are no mistakes in using the Spyder
- Resolve importerror: cannot import name ‘TF_ utils’
- [Solved] VUE-pdf Plugin use error: To install them, you can run: npm install –save core-js/modules/es
- Finally solved the importError: DLLload failed: the specified module could not be found when import matplotlib.pyplot
- nbconvert failed: xelatex not found on PATH, if you have not installed xelatex you may need to do so
- ImportError: cannot import name ‘SparkSession‘
- ImportError: cannot import name ‘cross_validation’ from ‘sklearn’
- from ._ NNLS import NNLS importerror: DLL load failed: the specified module was not found.
- Installation and use of graphviz under mac
- ImportError: cannot import name ‘SummaryWriter‘ from partially initialized module ‘torch.utils.tenso
- Import error, failed to import the debug version of PYD