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

[REQUEST] ConvLSTM2D model visualization issue #38

Closed jasonkyungkim closed 1 year ago

jasonkyungkim commented 1 year ago

Hi,

I was trying to use visualkeras to visualize my model architecture that looks like that following:

model = Sequential()
model.add(ConvLSTM2D(filters=4, kernel_size=(3, 3), padding='same',
                     activation='relu', 
                     return_sequences=True, 
                     input_shape=input_shape)) 

model.add(ConvLSTM2D(filters=1, kernel_size=(3, 3), padding='same',activation='relu', return_sequences=False))
model.add(Flatten())
model.add(Dense(15604, activation='linear')) 
model.add(Reshape((94, 166)))

It gave me an error that said

TypeError: 'int' object is not iterable

so I had to fork the entire repo and make changes to visualkeras/layered.py so that I have

x = min(max(shape[0] * scale_xy, x), max_xy)
y = min(max(shape[1] * scale_xy, y), max_xy)
z = min(max([z]), max_z)

instead of

x = min(max(shape[0] * scale_xy, x), max_xy)
y = min(max(shape[1] * scale_xy, y), max_xy)
z = min(max(self_multiply(shape[2:]) * scale_z, z), max_z)

It seems like someone ran into a similar issue pretty recently -- may I ask why such changes were made to how variable z is defined?

github-actions[bot] commented 1 year ago

Stale issue message