I have installed pydotplus and graphviz (I run Windows 10 and Python 3.6).
However, when I try to plot my Keras model I am getting an exception and I am asked to install pytdot and graphviz.
keras.utils.plot_model(model, 'my_first_model.png')
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\pydot.py in create(self, prog, format, encoding)
1914 arguments=arguments,
-> 1915 working_dir=tmp_dir,
1916 )
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\pydot.py in call_graphviz(program, arguments, working_dir, **kwargs)
135 stdout=subprocess.PIPE,
--> 136 **kwargs
137 )
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
708 errread, errwrite,
--> 709 restore_signals, start_new_session)
710 except:
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
996 os.fspath(cwd) if cwd is not None else None,
--> 997 startupinfo)
998 finally:
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tensorflow\python\keras\utils\vis_utils.py in _check_pydot()
44 # to check the pydot/graphviz installation.
---> 45 pydot.Dot.create(pydot.Dot())
46 except Exception:
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\pydot.py in create(self, prog, format, encoding)
1921 prog=prog)
-> 1922 raise OSError(*args)
1923 else:
FileNotFoundError: [WinError 2] "dot" not found in path.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-58-f0e169c88003> in <module>()
----> 1 keras.utils.plot_model(model, 'my_first_model.png')
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tensorflow\python\keras\utils\vis_utils.py in plot_model(model, to_file, show_shapes, show_layer_names, rankdir)
151 This enables in-line display of the model plots in notebooks.
152 """
--> 153 dot = model_to_dot(model, show_shapes, show_layer_names, rankdir)
154 _, extension = os.path.splitext(to_file)
155 if not extension:
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tensorflow\python\keras\utils\vis_utils.py in model_to_dot(model, show_shapes, show_layer_names, rankdir)
70 from tensorflow.python.util import nest
71
---> 72 _check_pydot()
73 dot = pydot.Dot()
74 dot.set('rankdir', rankdir)
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tensorflow\python\keras\utils\vis_utils.py in _check_pydot()
47 # pydot raises a generic Exception here,
48 # so no specific class can be caught.
---> 49 raise ImportError('Failed to import pydot. You must install pydot'
50 ' and graphviz for `pydotprint` to work.')
51
ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
It is not clear why I am getting this error message. Since I have already installed the packages, what else is left to do?
graphviz has been downloaded