Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: train() got an unexpected keyword argument 'callbacks' #403

Open
fferlito opened this issue Oct 24, 2023 · 0 comments
Open

TypeError: train() got an unexpected keyword argument 'callbacks' #403

fferlito opened this issue Oct 24, 2023 · 0 comments

Comments

@fferlito
Copy link

I used to use this repo using callbacks, so I could terminate the training with early stopping. I recently discovered that this is not an option anymore, and the parameter is not working anymore. Is there a reason of this?

This is the code that I used to run:

model = mobilenet_unet(n_classes=11,  input_height=1024, input_width=1024, channels=3  )
# When using custom callbacks, the default checkpoint saver is removed
callbacks = [
    ModelCheckpoint(
                filepath=checkpoint_path,
                save_weights_only=True,
                verbose=True,
                save_best_only=True,
                monitor='val_accuracy'
            ),
    EarlyStopping(patience=50,
                  monitor='val_accuracy')
]

print("Start training...")
model.train(
    train_images =  "train/backup/train_images/",
    train_annotations = "train/backup/train_labels/",
    epochs=100000,
    batch_size=5,
    gen_use_multiprocessing=False,
    do_augment=True,
    augmentation_name='aug_all',
    validate=True,
    val_images="train/test_images/",
    val_annotations="train//test_labels/",
    val_batch_size=1,
    steps_per_epoch=14,
    val_steps_per_epoch=19,
    #steps_per_epoch=733,
    #val_steps_per_epoch=73,
    callbacks=callbacks
)

From which I get:
model.train( TypeError: train() got an unexpected keyword argument 'callbacks'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant