I try visualize a Keras Model using Ipython and from keras.utis.vis_utils. But i receive the following error.
ImportError: Failed to import
pydot
. Please installpydot
. For example > withpip install pydot
.
Code used :
E.g model = ggv.h5
from IPython.display import SVG
from keras.utils.vis_utils import model_to_dot
SVG(model_to_dot(model).create(prog='dot', format='svg'))
Traceback
Traceback (most recent call last):
File "C:\Users\VW3ZTWS\PycharmProjects\Data_Collection_and_learnings\venv\lib\site-packages\IPython\core\interactiveshell.py", line 2869, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-49-b1aadf48e3ac>", line 5, in <module>
SVG(model_to_dot(model).create(prog='dot', format='svg'))
File "C:\Users\VW3ZTWS\PycharmProjects\Data_Collection_and_learnings\venv\lib\site-packages\keras\utils\vis_utils.py", line 55, in model_to_dot
_check_pydot()
File "C:\Users\VW3ZTWS\PycharmProjects\Data_Collection_and_learnings\venv\lib\site-packages\keras\utils\vis_utils.py", line 20, in _check_pydot
'Failed to import `pydot`. '
ImportError: Failed to import `pydot`. Please install `pydot`. For example with `pip install pydot`.
I tried to uninstall pydot, graphviz and again i installed it. But the error remains same.
In that case what will be the best solution to visualize the model