From 0f05b3a1aafe392fa661ceb88a7b59b0f98d5250 Mon Sep 17 00:00:00 2001 From: Syed Muhammad Sajjad <40227896+SajjadAliZaidi@users.noreply.github.com> Date: Sat, 19 Jun 2021 12:12:56 +0500 Subject: [PATCH 1/2] Update model.py updated mrcnn/model.py. added metrics_tensors array initialization line to remove error: 'Model' does not have attribute 'metrics_tensors' on line 2000 --- main/Mask_RCNN/mrcnn/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/main/Mask_RCNN/mrcnn/model.py b/main/Mask_RCNN/mrcnn/model.py index 62cb2b0..3360513 100644 --- a/main/Mask_RCNN/mrcnn/model.py +++ b/main/Mask_RCNN/mrcnn/model.py @@ -2162,6 +2162,7 @@ def compile(self, learning_rate, momentum): # First, clear previously set losses to avoid duplication self.keras_model._losses = [] self.keras_model._per_input_losses = {} + self.keras_model.metrics_tensors = [] loss_names = [ "rpn_class_loss", "rpn_bbox_loss", "mrcnn_class_loss", "mrcnn_bbox_loss", "mrcnn_mask_loss"] From 811b2d98f9a3e7cd5a291f65225e49b2a6bb3533 Mon Sep 17 00:00:00 2001 From: Syed Muhammad Sajjad <40227896+SajjadAliZaidi@users.noreply.github.com> Date: Sat, 19 Jun 2021 16:48:56 +0500 Subject: [PATCH 2/2] Update parallel_model.py Added super call to parent class in constructor --- main/Mask_RCNN/mrcnn/parallel_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/main/Mask_RCNN/mrcnn/parallel_model.py b/main/Mask_RCNN/mrcnn/parallel_model.py index d2bf53b..b1a2b28 100644 --- a/main/Mask_RCNN/mrcnn/parallel_model.py +++ b/main/Mask_RCNN/mrcnn/parallel_model.py @@ -32,6 +32,7 @@ def __init__(self, keras_model, gpu_count): keras_model: The Keras model to parallelize gpu_count: Number of GPUs. Must be > 1 """ + super(ParallelModel, self).__init__() self.inner_model = keras_model self.gpu_count = gpu_count merged_outputs = self.make_parallel()