title: keras stops working on first epoch
body: <p>I am running an image classification model. This is where I got stuck. Tried downgrading keras version to 1.0.2 and running the script again didn't work.</p>
  
  <p>Jupyter notebook just keeps processing and doesn't run anything after the first epoch, running code on keras 1.2 with python 3.5</p>
  
  <p>OUTPUT:</p>
  
  <pre><code>/anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/__main__.py:19: UserWarning: Update your `Dense` call to the Keras 2 API: `Dense(101, activation="softmax", kernel_initializer="glorot_uniform", kernel_regularizer=&lt;keras.reg...)`
  /anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/__main__.py:21: UserWarning: Update your `Model` call to the Keras 2 API: `Model(outputs=Tensor("de..., inputs=Tensor("in...)`
  /anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/__main__.py:44: UserWarning: The semantics of the Keras 2 argument `steps_per_epoch` is not the same as the Keras 1 argument `samples_per_epoch`. `steps_per_epoch` is the number of batches to draw from the generator at each epoch. Basically steps_per_epoch = samples_per_epoch/batch_size. Similarly `nb_val_samples`-&gt;`validation_steps` and `val_samples`-&gt;`steps` arguments have changed. Update your method calls accordingly.
  /anaconda/envs/py35/lib/python3.5/site-packages/ipykernel/__main__.py:44: UserWarning: Update your `fit_generator` call to the Keras 2 API: `fit_generator(&lt;image_gen..., verbose=2, epochs=32, validation_steps=25250, validation_data=&lt;image_gen..., steps_per_epoch=1183, callbacks=[&lt;keras.ca...)`
  Epoch 1/32
  </code></pre>
  
  <p>INPUT:</p>
  
  <pre><code>%%time
  from keras.models import Sequential, Model
  from keras.layers import Dense, Dropout, Activation, Flatten
  from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D, GlobalAveragePooling2D, AveragePooling2D
  from keras.layers.normalization import BatchNormalization
  from keras.preprocessing.image import ImageDataGenerator
  from keras.callbacks import ModelCheckpoint, CSVLogger, LearningRateScheduler, ReduceLROnPlateau
  from keras.optimizers import SGD
  from keras.regularizers import l2
  import keras.backend as K
  import math
  
  K.clear_session()
  
  base_model = InceptionV3(weights='imagenet', include_top=False, input_tensor=Input(shape=(299, 299, 3)))
  x = base_model.output
  x = AveragePooling2D(pool_size=(8, 8))(x)
  x = Dropout(.4)(x)
  x = Flatten()(x)
  predictions = Dense(n_classes, kernel_initializer='glorot_uniform', W_regularizer=l2(.0005), activation='softmax')(x)
  
  
  
  
  
  model = Model(input=base_model.input, output=predictions)
  
  opt = SGD(lr=.01, momentum=.9)
  model.compile(optimizer=opt, loss='categorical_crossentropy', metrics=['accuracy'])
  
  checkpointer = ModelCheckpoint(filepath='model4.{epoch:02d}-{val_loss:.2f}.hdf5', verbose=1, save_best_only=True)
  csv_logger = CSVLogger('model4.log')
  
  def schedule(epoch):
      if epoch &lt; 15:
          return .01
      elif epoch &lt; 28:
          return .002
      else:
          return .0004
  lr_scheduler = LearningRateScheduler(schedule)
  
  model.fit_generator(train_generator,
                      validation_data=test_generator,
                      nb_val_samples=X_test.shape[0],
                      samples_per_epoch=X_train.shape[0],
                      nb_epoch=32,
                      verbose=2,
                      callbacks=[lr_scheduler, csv_logger, checkpointer])
  </code></pre>