def assertModelAchievesAccuracy(self, model, target_accuracy, num_epochs=30):
    model.prepare_bottlenecks()
    print('Bottlenecks prepared')
    history = model.train_head(num_epochs)
    print('Training completed, history = {}'.format(history))
    accuracy = model.measure_inference_accuracy()
    print('Final accuracy = {:.2f}'.format(accuracy))
    self.assertGreater(accuracy, target_accuracy)
def assertModelAchievesAccuracy(self, model, target_accuracy, num_epochs=30):
    model.prepare_bottlenecks()
    print('Bottlenecks prepared')
    history = model.train_head(num_epochs)
    print('Training completed, history = {}'.format(history))
    accuracy = model.measure_inference_accuracy()
    print('Final accuracy = {:.2f}'.format(accuracy))
    self.assertGreater(accuracy, target_accuracy)