Beispiel #1
0
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)
Beispiel #2
0
def train_inception_v3():
    print('training inception_v3')
    model = create_inceptionv3()
    try:
        load_best_weights(model)
    except:
        print('Failed to load weigths')
    train(model)
Beispiel #3
0
def train_dense121():
    print('training densenet 121')
    model = create_dense121()
    try:
        load_best_weights(model)
    except:
        print('Failed to load weigths')
    train(model)
Beispiel #4
0
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)
Beispiel #5
0
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)
Beispiel #6
0
def train_res50():
    print('training resnet 50')
    model = create_res50()
    try:
        load_best_weights(model)
    except:
        print('Failed to load weigths')
    train(model)
Beispiel #7
0
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
Beispiel #8
0
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)
Beispiel #9
0
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)