1

How to get the number of floating-point operations performed by a Keras model in python?

Model.summary() only provides the number of trainable and non-trainable parameters. Can anyone plz tell me how to get the flop count for a keras model?

My model definition is:

model.add(Dense(32, input_dim=train.shape[1], activation='relu'))

model.add(Dense(len(label_list), activation='softmax'))

for me,

train_shape[1] = 128 label_list = 60

MSD Paul
  • 1,648
  • 3
  • 13
  • 31
  • Does this answer the question? https://stackoverflow.com/questions/49525776/how-to-calculate-a-mobilenet-flops-in-keras – benbotto Jan 06 '20 at 17:05
  • @avejidah, thanks for the reply. I have already tried this. But giving me the error of keras.backend has no attribute called get_session. Plz let me know if there exist any other methods. – MSD Paul Jan 06 '20 at 17:17

0 Answers0