def train_vgg16bn(): print('training vgg16bn') model = create_vgg16bn() try: load_best_weights(model) except: print('Failed to load weigths') train(model, max_num=1)
def train_inception_v3(): print('training inception_v3') model = create_inceptionv3() try: load_best_weights(model) except: print('Failed to load weigths') train(model)
def train_dense121(): print('training densenet 121') model = create_dense121() try: load_best_weights(model) except: print('Failed to load weigths') train(model)
def train_dense201(): print('training densenet 201') model = create_dense201() try: load_best_weights(model) except: print('Failed to load weigths') train(model, max_num=3)
def train_res152(): print('training resnet 152') model = create_res152() try: load_best_weights(model) except: print('Failed to load weigths') train(model, max_num=3)
def train_res50(): print('training resnet 50') model = create_res50() try: load_best_weights(model) except: print('Failed to load weigths') train(model)
def create_model(arch, fine_tune): print('Training {}...'.format(arch)) model = models.create_model(arch, fine_tune=fine_tune) try: load_best_weights(model) except: print('Failed to load weights') if not hasattr(model, 'max_num'): model.max_num = 2 return model
def train_net(model_name): print('Training {}...'.format(model_name)) model = create_model(model_name) try: load_best_weights(model) except: print('Failed to load weigths') if not hasattr(model, 'max_num'): model.max_num = 1 train(model)
def train_net(model_name, freeze=False, num_epochs=epochs): print('Training {}...'.format(model_name)) model = create_model(model_name) try: load_best_weights(model) except: print('Failed to load weigths') if not hasattr(model, 'max_num'): model.max_num = 2 train(model, freeze=freeze, num_epochs=num_epochs)