def METHOD_NAME(argv):
  del argv
  with ds_utils.MaybeDistributionScope.from_name(FLAGS.strategy):
    feature_extractor = make_feature_extractor(
        FLAGS.input_saved_model_dir,
        FLAGS.retrain,
        FLAGS.regularization_loss_multiplier)
    model = make_classifier(feature_extractor)
    model.compile(loss=tf.keras.losses.categorical_crossentropy,
                  optimizer=tf.keras.optimizers.SGD(),
                  metrics=['accuracy'])
  # Train the classifier (possibly on a different dataset).
  (x_train, y_train), (x_test, y_test) = mnist_util.load_reshaped_data(
      use_fashion_mnist=FLAGS.use_fashion_mnist,
      fake_tiny_data=FLAGS.fast_test_mode)
  print('Training on %s with %d trainable and %d untrainable variables.' %
        ('Fashion MNIST' if FLAGS.use_fashion_mnist else 'MNIST',
         len(model.trainable_variables), len(model.non_trainable_variables)))
  model.fit(x_train, y_train,
            batch_size=128,
            epochs=FLAGS.epochs,
            verbose=1,
            validation_data=(x_test, y_test))
  if FLAGS.output_saved_model_dir:
    if FLAGS.use_keras_save_api:
      tf.keras.models.save_model(model, FLAGS.output_saved_model_dir)
    else:
      tf.saved_model.save(model, FLAGS.output_saved_model_dir)