RedaOps / ann-visualizer

A python library for visualizing Artificial Neural Networks (ANN)
MIT License
1.24k stars 216 forks source link

crashes with functional model #14

Open btekgit opened 6 years ago

btekgit commented 6 years ago

When functional model is used, the api does not recognize input layer. ere is code `import keras; from keras.layers import Input, Dense from keras.models import Model

This returns a tensor

inputs = Input(shape=(784,))

a layer instance is callable on a tensor, and returns a tensor

l1 = Dense(units=800,kernel_initializer=keras.initializers.Ones(), activation='relu')(inputs) l2 = Dense(units=800,kernel_initializer=keras.initializers.Ones(), activation='relu')(l1) lo = Dense(10, activation='softmax')(l2)

This creates a model that includes

the Input layer and three Dense layers

model = Model(inputs=inputs, outputs=lo) model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])

from ann_visualizer.visualize import ann_viz;

ann_viz(model, title="");`

RedaOps commented 6 years ago

Can you post the error message you are getting?