Open trueToastedCode opened 2 years ago
got same error. In Azure Databricks Env: tensorflow==2.5.0 keras==2.4.3 SAME WITH keras==2.5.0rc0 numpy scipy Pillow cython matplotlib scikit-image opencv-python-headless h5py imgaug pycocotools
I tried some fixes suggested here: https://github.com/matterport/Mask_RCNN/issues/2458 but apperently they did not help or brought up new errors.
TypeError: Could not build a TypeSpec for <KerasTensor: shape=(None, None, 4) dtype=float32 (created by layer 'tf.math.truediv')> with type KerasTensor
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<command-3129758012267412> in <module>
1 # Create model in training mode
----> 2 model = modellib.MaskRCNN(mode="training", config=config,
3 model_dir=MODEL_DIR)
/Workspace/Repos/Mask_RCNN_tf_2.x/mrcnn/model.py in __init__(self, mode, config, model_dir)
1845 self.model_dir = model_dir
1846 self.set_log_dir()
-> 1847 self.keras_model = self.build(mode=mode, config=config)
1848
1849 def build(self, mode, config):
/Workspace/Repos/Mask_RCNN_tf_2.x/mrcnn/model.py in build(self, mode, config)
1883 shape=[None, 4], name="input_gt_boxes", dtype=tf.float32)
1884 # Normalize coordinates
-> 1885 gt_boxes = KL.Lambda(lambda x: norm_boxes_graph(
1886 x, K.shape(input_image)[1:3]))(input_gt_boxes)
1887 # 3. GT Masks (zero padded)
My environment:
Error causing code:
model = MaskRCNN(mode='training', model_dir="logs", config=config)
Error: