title: TypeError: '>' not supported between instances of 'NoneType' and 'float'
body: <p>I have this code and it raise an error in python 3 and such a comparison can work on python 2
  how can I change it?</p>
  <pre><code>import tensorflow as tf 
  def train_set():
      class MyCallBacks(tf.keras.callbacks.Callback):
          def on_epoch_end(self,epoch,logs={}):
              if(logs.get('acc')&gt;0.95):
                  print('the training will stop !')
                  self.model.stop_training=True
      callbacks=MyCallBacks()
      mnist_dataset=tf.keras.datasets.mnist 
      (x_train,y_train),(x_test,y_test)=mnist_dataset.load_data()
      x_train=x_train/255.0
      x_test=x_test/255.0
      classifier=tf.keras.Sequential([
                                      tf.keras.layers.Flatten(input_shape=(28,28)),
                                      tf.keras.layers.Dense(512,activation=tf.nn.relu),
                                      tf.keras.layers.Dense(10,activation=tf.nn.softmax)
                                      ])
      classifier.compile(
                          optimizer='sgd',
                          loss='sparse_categorical_crossentropy',
                          metrics=['accuracy']
                         )    
      history=classifier.fit(x_train,y_train,epochs=20,callbacks=[callbacks])
      return history.epoch,history.history['acc'][-1]
  train_set()
  </code></pre>