Using this code below;
plot_model(model, show_shapes=True, show_layer_names=True)
I get the following error message: InvocationException: Program terminated with status: 1. stderr follows: Format: "ps" not recognized.
How can I resolve the error above?
Your kind response is welcome.
CodePudding user response:
This problem is related to Graphviz on Windows. First install the following libraries; pip install pydot pip install graphviz pip install pydot_ng
Graphviz plugins need to be registered before they can be used. In Windows, open the command prompt as admin and type dot -c to register. You can verify it by typing dot –v
If you encounter the following error:
C:\Users\ugoch>dot -c Error: failed to open C:\Program Files\Graphviz 2.44.1\bin\config6 for write.
C:\Users\ugoch>dot -v dot - graphviz version 2.44.1 (20200629.0846)
There is no layout engine support for "dot" Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?
The next thing to do is to uninstall Graphviz from control panel and follow the steps below:
Visit the appropriate download location for your computer:
32-bit: https://www2.graphviz.org/Packages/stable/windows/10/cmake/Release/Win32/65
64-bit: https://www2.graphviz.org/Packages/stable/windows/10/cmake/Release/x64/896
- Download and run the graphviz-install-VERSION.exe file.
- Ignore any security warnings you might get.
- During the installation, make sure you select “Add Graphviz top the system PATH for current user”.
- When the installation is finished, start CMD as an administrator
- Run dot -c in the Administrator: Console Prompt window.
- Restart any applications or Command prompts where you want to use Graphviz. Try restarting your computer if you still have problems starting Graphviz.