Skip to content

"TypeError: data type not understood" error in Official Object Detection Tutorial #8812

@mburakbozbey

Description

@mburakbozbey

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [+ ] I am using the latest TensorFlow Model Garden release and TensorFlow 2.
  • [+] I am reporting the issue to the correct repository. (Model Garden official or research directory)
  • [+ ] I checked to make sure that this issue has not already been filed.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/object_detection/utils/visualization_utils.py

2. Describe the bug

In object_detection.utils.ops, "reframe_box_masks_to_image_masks" function returns TypeError

3. Steps to reproduce

Run official object detection colab tutorial notebook, instance segmentation part fails to produce segmentation mask when using show_inference function
https://colab.research.google.com/github/tensorflow/models/blob/master/research/object_detection/colab_tutorials/object_detection_tutorial.ipynb

4. Expected behavior

Image with segmentation mask was available in 2-3 days ago.
from object_detection.utils import visualization_utils as vis_util
vis_util.visualize_boxes_and_labels_on_image_array() function gives type error when image with segmentation mask is requested.

5. Additional context

"""
TypeError Traceback (most recent call last)
in ()
----> 1 show_inference(masking_model, "/content/Screenshot_3.jpg")

2 frames
/usr/local/lib/python3.6/dist-packages/object_detection/utils/ops.py in reframe_box_masks_to_image_masks(box_masks, boxes, image_height, image_width, resize_method)
823 def reframe_box_masks_to_image_masks_default():
824 """The default function when there are more than 0 box masks."""
--> 825 def transform_boxes_relative_to_boxes(boxes, reference_boxes):
826 boxes = tf.reshape(boxes, [-1, 2, 2])
827 min_corner = tf.expand_dims(reference_boxes[:, 0:2], 1)

TypeError: data type not understood
""""

6. System information

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions