title: error when trying to use keras.utils.plot_model
body: <p>I am trying to make a plot/graph of deep learning model in Python using Keras package but unfortunately it keeps giving me an error which is not very informative.</p>
  
  <p>I run python on Linux with Python 3.5.2, Anaconda 4.2.0, Keras 2.1.6 and I use tensorflow-gpu 1.7.0 Backend.</p>
  
  <p>Here is the error message:</p>
  
  <pre><code>keras.utils.plot_model(unet, to_file='model.png', show_shapes=False, show_layer_names=True, rankdir='TB')
  
  ['dot', '-Tps', '/tmp/tmphesl1j0c'] return code: 127
  
  stdout, stderr:
   b''
  b'dot: error while loading shared libraries: libexpat.so.0: cannot open shared object file: No such file or directory\n'
  
  ---------------------------------------------------------------------------
  AssertionError                            Traceback (most recent call last)
  &lt;ipython-input-9-60bb0e3b97bd&gt; in &lt;module&gt;()
  ----&gt; 1 keras.utils.plot_model(unet, to_file='model.png', show_shapes=False, show_layer_names=True, rankdir='TB')
  
  /.../anaconda3-4.2.0/lib/python3.5/site-packages/keras/utils/vis_utils.py in plot_model(model, to_file, show_shapes, show_layer_names, rankdir)
      132             'LR' creates a horizontal plot.
      133     """
  --&gt; 134     dot = model_to_dot(model, show_shapes, show_layer_names, rankdir)
      135     _, extension = os.path.splitext(to_file)
      136     if not extension:
  
  /.../anaconda3-4.2.0/lib/python3.5/site-packages/keras/utils/vis_utils.py in model_to_dot(model, show_shapes, show_layer_names, rankdir)
       53     from ..models import Sequential
       54 
  ---&gt; 55     _check_pydot()
       56     dot = pydot.Dot()
       57     dot.set('rankdir', rankdir)
  
  /.../anaconda3-4.2.0/lib/python3.5/site-packages/keras/utils/vis_utils.py in _check_pydot()
       24         # Attempt to create an image of a blank graph
       25         # to check the pydot/graphviz installation.
  ---&gt; 26         pydot.Dot.create(pydot.Dot())
       27     except OSError:
       28         raise OSError(
  
  /.../anaconda3-4.2.0/lib/python3.5/site-packages/pydot.py in create(self, prog, format, encoding)
     1882                      out=stdout_data,
     1883                      err=stderr_data))
  -&gt; 1884         assert p.returncode == 0, p.returncode
     1885         return stdout_data
  
  AssertionError: 127
  </code></pre>
  
  <p>I would really appreciate if somebody could help me with this error.</p>
  
  <p>Note: both pydot and graphviz are intalled</p>