Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model = MaskRCNN(mode='training', model_dir=DEFAULT_LOGS_DIR, config=config) #3015

Open
sai12092003 opened this issue Jan 6, 2024 · 0 comments

Comments

@sai12092003
Copy link

anyone who cleared this error


TypeError Traceback (most recent call last)

201 # define the model

--> 202 model = MaskRCNN(mode='training', model_dir=DEFAULT_LOGS_DIR, config=config)
203 # load weights (mscoco) and exclude the output layers
204 model.load_weights(COCO_WEIGHTS_PATH, by_name=True, exclude=["mrcnn_class_logits", "mrcnn_bbox_fc", "mrcnn_bbox", "mrcnn_mask"])

3 frames
/usr/local/lib/python3.10/dist-packages/mrcnn/model.py in init(self, mode, config, model_dir)
1830 self.model_dir = model_dir
1831 self.set_log_dir()
-> 1832 self.keras_model = self.build(mode=mode, config=config)
1833
1834 def build(self, mode, config):

/usr/local/lib/python3.10/dist-packages/mrcnn/model.py in build(self, mode, config)
1868 shape=[None, 4], name="input_gt_boxes", dtype=tf.float32)
1869 # Normalize coordinates
-> 1870 gt_boxes = KL.Lambda(lambda x: norm_boxes_graph(
1871 x, K.shape(input_image)[1:3]))(input_gt_boxes)
1872 # 3. GT Masks (zero padded)

/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py in error_handler(*args, **kwargs)
68 # To get the full stack trace, call:
69 # tf.debugging.disable_traceback_filtering()
---> 70 raise e.with_traceback(filtered_tb) from None
71 finally:
72 del filtered_tb

/usr/local/lib/python3.10/dist-packages/tensorflow/python/framework/type_spec.py in type_spec_from_value(value)
1002 3, "Failed to convert %r to tensor: %s" % (type(value).name, e))
1003
-> 1004 raise TypeError(f"Could not build a TypeSpec for {value} of "
1005 f"unsupported type {type(value)}.")
1006

TypeError: Could not build a TypeSpec for KerasTensor(type_spec=TensorSpec(shape=(None, None, 4), dtype=tf.float32, name=None), name='tf.math.truediv_2/truediv:0', description="created by layer 'tf.math.truediv_2'") of unsupported type <class 'keras.src.engine.keras_tensor.KerasTensor'>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant