小编Sab*_*ina的帖子

尝试使用 keras.utils.plot_model 时出错

我正在尝试使用 Keras 包在 Python 中制作深度学习模型的绘图/图形,但不幸的是它不断给我一个错误,这不是很有用。

我在 Linux 上使用 Python 3.5.2、Anaconda 4.2.0、Keras 2.1.6 运行 python,我使用 tensorflow-gpu 1.7.0 后端。

这是错误消息:

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)
<ipython-input-9-60bb0e3b97bd> in <module>()
----> 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 …
Run Code Online (Sandbox Code Playgroud)

python keras tensorflow

5
推荐指数
4
解决办法
1万
查看次数

标签 统计

keras ×1

python ×1

tensorflow ×1