jphall663 / interpretable_machine_learning_with_python

Examples of techniques for training interpretable ML models, explaining ML models, and debugging ML models for accuracy, discrimination, and security.
669 stars 207 forks source link

Issue with Graphviz #4

Closed mananshukla6 closed 4 years ago

mananshukla6 commented 5 years ago

Hey,

Firstly, this is an amazing work of yours. I really admire what you have done. I am facing a small issue while displaying the png file. I cannot convert it from dot to png. Can you please help me with this?

jphall663 commented 5 years ago

Do you mean the code in the notebook does not work?

mananshukla6 commented 5 years ago

The code works completely fine, just the GraphViz portion throws an error. I have already created the .gv file and when I am trying to convert that to a png file it says "File not found"

jphall663 commented 5 years ago

I'll need a lot more info to help here ...

Are you using the Docker container? Or did you attempt to install the dependencies yourself?

Are you sure GraphViz is installed and on your path? What happens when you type dot -Tpng in your console?

Are you sure the .gv file was really created? What is the output of ls or dir (on windows) in the root directory of the repo after you run the cell that creates the .gv?

Thanks!

sarvendras commented 5 years ago

@jphall663 this is a great article thanks much. I am getting error at these lines under heading(Create PNG from GraphViz dot file and display) _ = subprocess.call(png_args) Error description: FileNotFoundError: [WinError 2] The system cannot find the file specified

I have also installed GraphViz using pip command and using anaconda spyder as IDE. One more doubt I am executing all code in python only ..while in thread you mentioned that "Then a GraphViz command line tool is used to create a static PNG image from the dot file "..what does it mean..

Please let me know if anything more information is required..

Thanks. Sarvendra

sarvendras commented 5 years ago

@jphall663 Please help to suggest..this is little urgent :)

Jinruizhang01 commented 4 years ago

Hi, Sarvendra,

I think you need to add shell=True : _ = subprocess.call(png_args, shell=True)

Hope you can solve the problem.

-Jin

jphall663 commented 4 years ago

Sorry for any inconvenience and how long it took me to respond. I incorporated the comment above into the code comments. Hope that helps in the future!