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] #46

Closed Jeff-Winchell closed 7 months ago

Jeff-Winchell commented 11 months ago

both graph_view and layered_view failed to work. I see no updates to this code in 2 years so it seems like a dead project.

2 visualkeras.graph_view(model).show() File ~\miniconda3\envs\NLP_TF\lib\site-packages\visualkeras\layer_utils.py:39, in model_to_adj_matrix(model) 37 if not model.built: 38 model.build() ---> 39 layers = model._layers 41 adj_matrix = np.zeros((len(layers), len(layers))) 42 id_to_num_mapping = dict()

AttributeError: 'Functional' object has no attribute '_layers'

File ~\miniconda3\envs\NLP_TF\lib\site-packages\visualkeras\graph.py:58, in graph_view(model, to_file, color_map, node_size, background_fill, padding, layer_spacing, node_spacing, connector_fill, connector_width, ellipsize_after, inout_as_tensor, show_neurons) 54 layer_y = list() 56 # Attach helper layers ---> 58 id_to_num_mapping, adj_matrix = model_to_adj_matrix(model) 59 model_layers = model_to_hierarchy_lists(model, id_to_num_mapping, adj_matrix) 61 # add fake output layers

 2 visualkeras.layered_view(model).show()

File ~\miniconda3\envs\NLP_TF\lib\site-packages\visualkeras\layered.py:100, in layered_view(model, to_file, min_z, min_xy, max_z, max_xy, scale_z, scale_xy, type_ignore, index_ignore, color_map, one_dim_orientation, background_fill, draw_volume, padding, spacing, draw_funnel, shade_step, legend, font, font_color) 98 x = min(max(shape[1] scale_xy, x), max_xy) 99 y = min(max(shape[2] scale_xy, y), max_xy) --> 100 z = min(max(z), max_z) 101 elif len(shape) == 2: 102 if one_dim_orientation == 'x':

TypeError: 'int' object is not iterable

Meanwhile graphviz is an installation nightmare so no usable visualization tools exist for deep learning with python. Sad.

esrasiler commented 10 months ago

I have similar problem. Did you find another library since this one is not updated recently?

Jeff-Winchell commented 10 months ago

no

sevginurbilgin commented 10 months ago

I have similar problem.

0xArwa commented 10 months ago

same issue, did anyone figure how to solve this?

github-actions[bot] commented 8 months ago

Stale issue message