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

negative samples are not implemented for mmdet models #1118

Open
rbavery opened this issue Jul 13, 2022 · 1 comment
Open

negative samples are not implemented for mmdet models #1118

rbavery opened this issue Jul 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@rbavery
Copy link

rbavery commented Jul 13, 2022

🐛 Bug

Describe the bug
Negative samples still needs to be implemented. This error might appear due to cropping, please check your transformations.

To Reproduce
train a model with

model_type = models.mmdet.mask_rcnn
backbone = model_type.backbones.mask_rcnn_swin_t_p4_w7_fpn_1x_coco

and use a dataloader containing negative samples

Expected behavior
Negative samples are supported, but the clear error is appreciated.

Additional context
full traceback

RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/root/work/.ice-env/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/root/work/.ice-env/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 39, in fetch
    data = next(self.dataset_iter)
  File "/root/work/.ice-env/lib/python3.9/site-packages/fastai/data/load.py", line 136, in create_batches
    yield from map(self.do_batch, self.chunkify(res))
  File "/root/work/.ice-env/lib/python3.9/site-packages/fastai/data/load.py", line 166, in do_batch
    def do_batch(self, b): return self.retain(self.create_batch(self.before_batch(b)), b)
  File "/root/icevision/icevision/engines/fastai/adapters/convert_dataloader_to_fastai.py", line 18, in create_batch
    return (dataloader.collate_fn, raise_error_convert)[self.prebatched](b)
  File "/root/icevision/icevision/models/utils.py", line 88, in inner
    tupled_output, records = build_batch(records)
  File "/root/icevision/icevision/models/utils.py", line 79, in inner
    return build_batch(records, **build_batch_kwargs)
  File "/root/icevision/icevision/models/mmdet/common/mask/dataloaders.py", line 63, in build_valid_batch
    return build_train_batch(records=records)
  File "/root/icevision/icevision/models/mmdet/common/mask/dataloaders.py", line 75, in build_train_batch
    masks.append(_masks(record))
  File "/root/icevision/icevision/models/mmdet/common/mask/dataloaders.py", line 110, in _masks
    raise RuntimeError(
RuntimeError: Negative samples still needs to be implemented. This error might appear due to cropping, please check your transformations.
@rbavery rbavery added the bug Something isn't working label Jul 13, 2022
@ChristianMarzahl
Copy link

ChristianMarzahl commented Aug 30, 2022

Dear @rbavery,

I just came across the same bug. Did you find a solution to this to this issue? I tried introducing small background boxes and masks but this hack causes problems at later stages of the pipeline.

With kind regards,
Christian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants