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.
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
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.