Tensorflow: 'Model' object has no attribute 'container_nodes'

Created on 14 Nov 2017  ·  1Comment  ·  Source: tensorflow/tensorflow

Problem

model = tf.keras.models.Model()
model.add(...)
tf.keras.utils.plot_model(model, to_file="model.png")

Output:

Traceback (most recent call last):
  File "model.py", line 36, in <module>
    K.utils.plot_model(model, to_file="model.png")
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/keras/_impl/keras/utils/vis_utils.py", line 148, in plot_model
    dot = model_to_dot(model, show_shapes, show_layer_names, rankdir)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/keras/_impl/keras/utils/vis_utils.py", line 123, in model_to_dot
    if node_key in model.container_nodes:
AttributeError: 'Model' object has no attribute 'container_nodes'

Environment

-System: Ubuntu 16.04
-Tensorflow-gpu bin v1.4.0-rc1-11-g130a514 1.4.0

awaiting tensorflower bug

Most helpful comment

model_to_dot() does not work since commit 3599fd4. A minor fix seems works.

>All comments

model_to_dot() does not work since commit 3599fd4. A minor fix seems works.

Was this page helpful?
0 / 5 - 0 ratings