'NoneType' object has no attribute 'fit'

While trying to run the following block of code i keep getting the error: NoneType’ object has no attribute ‘fit’. What could be wrong, please?

model = create_model(NUM_WORDS, EMBEDDING_DIM, MAXLEN)

history = model.fit(train_padded_seq, train_label_seq, epochs=30, validation_data=(val_padded_seq, val_label_seq))

Problem solved. The problem was caused by not returning the model from the function used for model creation and compiling.