matterport/Mask_RCNN

TypeError: train() got an unexpected keyword argument 'custom_callbacks'

Closed this issue · 3 comments

Hi, if I want to add custom_callbacks to my training, I got the error:

File ".../MaskRCNN/training.py", line 267, in <module>
    train(model)
  File ".../MaskRCNN/training.py", line 233, in train
    custom_callbacks=[early_stopping, checkpoint])
TypeError: train() got an unexpected keyword argument 'custom_callbacks'

My Code:

training.py

early_stopping = EarlyStopping(monitor='loss', min_delta=0, patience=50, verbose=1, mode='auto')
checkpoint = ModelCheckpoint('MODEL/' + MODEL_NAME + '.h5', verbose=1,
                                 save_weights_only=False, mode='auto', period=1)
model.train(dataset_train, dataset_test,
                learning_rate=WearFormConfig.LEARNING_RATE,
                epochs=EPOCHS,
                layers='heads',
                custom_callbacks=[early_stopping, checkpoint, WandbCallback()])

model.py

class MaskRCNN():
...
def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,
            augmentation=None, custom_callbacks=None, no_augmentation_sources=None):
...

My Setup:
tensorflow(-gpu) 1.13.1
keras 2.0.8

The error occurs on CPU and GPU.

how you solve this problem?

@Joanne513 there was a sync problem of the code, so the error was not in the code. The code who hast to be modified was located at:
<Path to your environment>\Lib\site-packages\mrcnn\model.py
If I change it there it works. Hope this helps you

@Joanne513 there was a sync problem of the code, so the error was not in the code. The code who hast to be modified was located at:
<Path to your environment>\Lib\site-packages\mrcnn\model.py
If I change it there it works. Hope this helps you

thanks, i will try!