Running the code in Keras 2,python3.6 occurs an attributeerror

In Keras 2, nb_class is renamed to num_class and nb_sample to samples.

Have a look at this link for related discussion. Keras 2 Released