image-segmentation-keras icon indicating copy to clipboard operation
image-segmentation-keras copied to clipboard

AttributeError: 'CheckpointsCallback' object has no attribute '_implements_train_batch_hooks'

Open joshuachang2311 opened this issue 5 years ago • 3 comments
trafficstars

I followed the tutorial and typed the following code.

from keras_segmentation.models.unet import vgg_unet
model = vgg_unet(n_classes=51, input_height=416, input_width=608)
model.train(
    train_images =  "dataset_path/images_prepped_train/",
    train_annotations = "dataset_path/annotations_prepped_train/",
    checkpoints_path = "checkpoints/vgg_unet_1" , epochs=5
)

And then this occurred.

c:\users\joshua2018\anaconda3\envs\semantic-segmentation\lib\site-packages\tensorflow\python\keras\callbacks.py in <genexpr>(.0)
    229     # pylint: disable=protected-access
    230     self._should_call_train_batch_hooks = any(
--> 231         cb._implements_train_batch_hooks() for cb in self.callbacks)
    232     self._should_call_test_batch_hooks = any(
    233         cb._implements_test_batch_hooks() for cb in self.callbacks)

AttributeError: 'CheckpointsCallback' object has no attribute '_implements_train_batch_hooks'

joshuachang2311 avatar Jun 23 '20 06:06 joshuachang2311

I have the same issue. Any solution?

forest44 avatar Jun 27 '20 14:06 forest44

a solution is given there

forest44 avatar Jun 28 '20 10:06 forest44

I don't think that's the reason. I only imported one single thing, and if there should be any problems it's not the difference between keras and tensorflow.keras.

joshuachang2311 avatar Jun 29 '20 01:06 joshuachang2311