paulgavrikov / visualkeras

Visualkeras is a Python package to help visualize Keras (either standalone or included in TensorFlow) neural network architectures. It allows easy styling to fit most needs. This module supports layered style architecture generation which is great for CNNs (Convolutional Neural Networks), and a graph style architecture, which works great for most models including plain feed-forward networks.
MIT License
582 stars 67 forks source link

[BUG] The visualized model is not really correct. #39

Closed mir7b closed 1 year ago

mir7b commented 1 year ago

Describe the bug

  1. Still getting the error TypeError: 'int' object is not iterable. https://github.com/paulgavrikov/visualkeras/issues/15#issuecomment-956065285 solved the issue, but you might want to update the pip files after two years.
  2. Mutlimodal model (two inputs) but the produced image is just showing one input... or rather, mixing the two if you look closely.

Minimal Code To Reproduce

self.input1_shape = (100, 100, 3)
self.input2_shape = 9
first_input = layers.Input(shape=self.input1_shape)
b0 = layers.AveragePooling2D((3, 3), name='pool_in')(first_input)
b1 = layers.Flatten()(b0)
second_input = layers.Input(shape=(1, self.input2_shape))
b2 = layers.Flatten()(second_input)
b5 = layers.Concatenate()([ b1, b2 ]) 
b6 = layers.Dense(256 , activation="relu", name='d3')(b5)
b7 = layers.Dense(16 , activation="relu", name='d4')(b6)
out = layers.Dense(1, activation="softsign")(b7)
model2 = Model(inputs=[first_input, second_input], outputs=out)
visualkeras.layered_view(model2, legend=True, font=font, to_file=self.wdir+'/model2_vk.png')

Image model

Environment

github-actions[bot] commented 1 year ago

Stale issue message