keras icon indicating copy to clipboard operation
keras copied to clipboard

Module 'pydot' has no attribute 'InvocationException'

Open novalex9800 opened this issue 1 year ago • 3 comments

The error occured using plot_model with the latest newly installed versions of pydot and graphviz. I tried to follow the instructions in issue 3210 to no avail. Specifically I tried

pip install pydot-ng pip install pydot==1.0.2 --upgrade (but not sudo pip install pydot==1.0.2 --upgrade because I do not have administrative priveledges on this system)

novalex9800 avatar Jan 08 '24 10:01 novalex9800

Hi @novalex9800 ,

The error indicates the installed version of pydot might be older and don't have attribute InvocationException.

You might need pydot_ng ~=2.0.0 with keras3. I tested installing pydot_ng=1.0.0 & 2.0.0 , pydot=1.4.2 and called pydot.InvocationException() which is success.Please refer attached gist.

You might need to ensure latest pydot_ng and make sure it was imported. Please submit the version of pydot_ng imported. May be you can create a separate environment of your own.

SuryanarayanaY avatar Jan 08 '24 14:01 SuryanarayanaY

I got the same error when trying to use the 'plot_model' function of Keras in TensorFlow. This function uses both pydot and graphviz, and I solved the problem by properly installing graphviz. I installed graphviz (on Windows OS) using the executable file that can be found here - https://forum.graphviz.org/t/new-simplified-installation-procedure-on-windows/224

I hope this helps!!

ayodejimb avatar Jan 20 '24 13:01 ayodejimb

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Feb 05 '24 01:02 github-actions[bot]

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

github-actions[bot] avatar Feb 20 '24 01:02 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Feb 20 '24 01:02 google-ml-butler[bot]

The issue still persists!

iamtekson avatar Feb 23 '24 17:02 iamtekson

Same here, the issue still persists for me!

TahaSherif avatar Mar 05 '24 16:03 TahaSherif

possible solution: I installed pydot==2.0.0 and graphviz and the issue still persisted for me. However, after just simply restarting the pc, the issue was gone. Not sure if this simple solution helps, but you can try it :) good luck!

ztsv-av avatar Apr 13 '24 09:04 ztsv-av

Please refer your tensorflow version when you ask about these packages issues, because most of the time it is just version compatibility. For me i just had to close the pycharm project and reopen it to get it work.

Nourine-Nadir avatar Apr 17 '24 09:04 Nourine-Nadir

tensorflow 2.16.1. The problem still exists image

MrOxMasTer avatar May 31 '24 14:05 MrOxMasTer

I installed pydot version 1.4.2 and now there is another error

You must install graphviz (see instructions at https://graphviz.gitlab.io/download/) for `plot_model` to work.

While I have already installed both version 11 and version 2.5 of this tool and it still doesn't work

MrOxMasTer avatar May 31 '24 15:05 MrOxMasTer

I installed version 2.46 of graphviz and rebooted the computer. Everything worked

MrOxMasTer avatar May 31 '24 15:05 MrOxMasTer

I had the same issue, I have a conda environment with python3.11.9, and what worked for me was

pip install pydot==2.0.0
sudo apt install graphviz

syedalimohsinbukhari avatar Jun 11 '24 03:06 syedalimohsinbukhari

for Mac: brew install graphviz problem's gone

vmlstandard avatar Jun 20 '24 17:06 vmlstandard

I'm using tensorflow 2.16.1 with a Conda environment on macOS. The following worked for me:

pip install pydot
conda install graphviz

0xAtlxolotlz avatar Jun 22 '24 14:06 0xAtlxolotlz

I'm using 'Windows-10-10.0.22631-SP0' with tensorflow 2.16.1, keras 3.4.1 in Conda environment. I had the same issue, and was fixed with the following:

pip install pydot # 2.0.0
conda install graphviz # 2.50.0

gayanlanke avatar Jun 28 '24 04:06 gayanlanke

I'm using tf 2.16.1 and keras 3.4.1 with ubuntu2204.I had the same issue, and fixed.

pip install pydot  
sudo apt install graphviz

Leo-jiahao avatar Jun 29 '24 14:06 Leo-jiahao

For Mac M2 Keras: 3.4.1 pydot: 1.4.2 brew install graphviz

AnushangaWimalasena avatar Jul 03 '24 02:07 AnushangaWimalasena

I had the same issue, I have a conda environment with python3.11.9, and what worked for me was

pip install pydot==2.0.0
sudo apt install graphviz

On Ubuntu 22.04.4 and sudo apt install graphviz worked for me

FynnGilbert avatar Jul 04 '24 11:07 FynnGilbert

tensorflow 2.16.1. The problem still exists image

Hi, Did you solve the issue?? if yes, could you tell me how??

ali-kanbar avatar Jul 15 '24 17:07 ali-kanbar