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

AttributeError: 'BitMasks' object has no attribute 'polygons' #101

Open
Adam1904 opened this issue Mar 18, 2023 · 0 comments
Open

AttributeError: 'BitMasks' object has no attribute 'polygons' #101

Adam1904 opened this issue Mar 18, 2023 · 0 comments

Comments

@Adam1904
Copy link

Adam1904 commented Mar 18, 2023

Hello @youngwanLEE ,

I am trying to implement CenterMask2 https://github.com/youngwanLEE/centermask2 which makes use of Detectron2.
My annotations are in COCO RLE format, my data registration is successful. I visualized the data as well using the detectron2 visualizer, also I have set cfg.INPUT.MASk_FORMAT= bitmask, but somehow this error is being raised while I try to train the network.

Can somebody help me out here with what could be done?

  File "train_net.py", line 181, in <module>
    launch(
  File "/workspace/detectron2/detectron2/engine/launch.py", line 84, in launch
    main_func(*args)
  File "train_net.py", line 151, in main
    return trainer.train()
  File "/workspace/detectron2/detectron2/engine/defaults.py", line 484, in train
    super().train(self.start_iter, self.max_iter)
  File "/workspace/detectron2/detectron2/engine/train_loop.py", line 155, in train
    self.run_step()
  File "/workspace/detectron2/detectron2/engine/defaults.py", line 494, in run_step
    self._trainer.run_step()
  File "/workspace/detectron2/detectron2/engine/train_loop.py", line 287, in run_step
    loss_dict = self.model(data)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/workspace/detectron2/detectron2/modeling/meta_arch/rcnn.py", line 167, in forward
    _, detector_losses = self.roi_heads(images, features, proposals, gt_instances)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/workspace/centermask2/centermask/modeling/centermask/center_heads.py", line 401, in forward
    losses, mask_features, selected_mask, labels, maskiou_targets = self._forward_mask(features, proposals)
  File "/workspace/centermask2/centermask/modeling/centermask/center_heads.py", line 476, in _forward_mask
    loss, selected_mask, labels, maskiou_targets = mask_rcnn_loss(mask_logits, proposals, self.maskiou_on)
  File "/workspace/centermask2/centermask/modeling/centermask/mask_head.py", line 80, in mask_rcnn_loss
    cropped_mask = crop(instances_per_image.gt_masks.polygons, instances_per_image.proposal_boxes.tensor)
AttributeError: 'BitMasks' object has no attribute 'polygons'
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