#3038·Mask_RCNN

We could not automatically infer the shape of the Lambda's output. Please specify the `output_shape` argument for this Lambda layer.

Author: zlao3118Created Jun 6, 2024Updated Oct 28, 2025

Traceback (most recent call last): File "D:\Mask_RCNN-2.1\Mask_RCNN-2.1\samples\balloon\balloon.py", line 332, in model = modellib.MaskRCNN(mode="inference", config=config, File "D:\Mask_RCNN-2.1\Mask_RCNN-2.1\samples\balloon\model.py", line 1768, in init self.keras_model = self.build(mode=mode, config=config) File "D:\Mask_RCNN-2.1\Mask_RCNN-2.1\samples\balloon\model.py", line 1950, in build fpn_classifier_graph(rpn_rois, mrcnn_feature_maps, config.IMAGE_SHAPE, File "D:\Mask_RCNN-2.1\Mask_RCNN-2.1\samples\balloon\model.py", line 916, in fpn_classifier_graph shared = KL.Lambda(lambda x: K.squeeze(K.squeeze(x, 3), 2), File "D:\python310\lib\site-packages\keras\src\\utils\traceback_utils.py", line 122, in error_handler raise e.with_traceback(filtered_tb) from None File "D:\python310\lib\site-packages\keras\src\layers\core\lambda_layer.py", line 95, in compute_output_shape raise NotImplementedError( NotImplementedError: Exception encountered when calling Lambda.call().

We could not automatically infer the shape of the Lambda's output. Please specify the output_shape argument for this Lambda layer.

Arguments received by Lambda.call(): • args=('<KerasTensor shape=(None, 1000, 1, 1, 1024), dtype=float32, sparse=False, name=keras_tensor_428>',) • kwargs={'mask': 'None'}