yu4u / convnet-drawer

Python script for illustrating Convolutional Neural Networks (CNN) using Keras-like model definitions
MIT License
596 stars 98 forks source link

Unable to save model as pptx file #6

Open ngenne opened 6 years ago

ngenne commented 6 years ago

Hi there,

Another error to declare:

  File "C:\Users\ngenne\Desktop\PRIVE-Deep-Learning\NIH\chest-xray\convnet_drawer\pptx_util.py", line 63, in save_model_to_pptx
    for feature_map in model.feature_maps + model.layers:

AttributeError: 'Sequential' object has no attribute 'feature_maps'

Code is below:

from convnet_drawer.convnet_drawer import Model, Conv2D, MaxPooling2D, Flatten, Dense
from convnet_drawer.keras_util import convert_drawer_model
from convnet_drawer.matplotlib_util import save_model_to_file
from convnet_drawer.pptx_util import save_model_to_pptx
from keras.models import Sequential
from convnet_drawer.keras_models import AlexNet

classifier = Sequential()

classifier = Model(input_shape=(1024, 1024, 1))
classifier.add(Conv2D(512, (256,256), strides=(4, 4), padding="same"))
classifier.add(MaxPooling2D(pool_size=(2, 2)))
classifier.add(Conv2D(512, (256,256), strides=(4, 4), padding="same"))
classifier.add(Conv2D(512, (256,256), strides=(4, 4), padding="same"))
classifier.add(MaxPooling2D(pool_size=(2, 2)))
classifier.add(Flatten())
classifier.add(Dense(4096))
classifier.add(Dense(4096))
classifier.add(Dense(1000))

classifier = AlexNet.get_model()
classifier_seq = convert_drawer_model(classifier)

classifier.save_model_to_pptx(classifier, "classifier.pptx")

Could you help me please?

yu4u commented 6 years ago

Please refer to https://github.com/yu4u/convnet-drawer/issues/5