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

assert img.shape[:2] == (self.h, self.w) AssertionError #5385

Open
Raneem-MT opened this issue Oct 30, 2024 · 1 comment
Open

assert img.shape[:2] == (self.h, self.w) AssertionError #5385

Raneem-MT opened this issue Oct 30, 2024 · 1 comment

Comments

@Raneem-MT
Copy link

Raneem-MT commented Oct 30, 2024

I am evaluating MaskDINO, which uses detectron2. I have seen a similar issue, saying this error can be caused by mismatched sizes between the masks and images, but I checked that the sizes match.
I evaluated other datasets with no problem, but I ran into issues with this one.
I pre-processed the images the same way and checked that the sized made sense. I printed out the shapes but cannot trace back where exactly this shape issue occurred. This is the full error message:

AssertionError: Caught AssertionError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/torch/util s/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/torch/util s/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/torch/util s/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/detectron2 /data/common.py", line 90, in getitem
data = self._map_func(self._dataset[cur_idx])
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/detectron2 /data/dataset_mapper.py", line 164, in call
transforms = self.augmentations(aug_input)
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/detectron2 /data/transforms/augmentation.py", line 264, in call
tfm = x(aug_input)
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/detectron2 /data/transforms/augmentation.py", line 170, in call
aug_input.transform(tfm)
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/detectron2 /data/transforms/augmentation.py", line 339, in transform
self.sem_seg = tfm.apply_segmentation(self.sem_seg)
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/detectron2 /data/transforms/transform.py", line 155, in apply_segmentation
segmentation = self.apply_image(segmentation, interp=Image.NEAREST)
File "/jmain02/home/J2AD014/mtc11/rxt49-mtc11/.conda/envs/maskdino/lib/python3.8/site-packages/detectron2 /data/transforms/transform.py", line 113, in apply_image
assert img.shape[:2] == (self.h, self.w)
AssertionError

Has anyone solved this?

@github-actions github-actions bot added the needs-more-info More info is needed to complete the issue label Oct 30, 2024
Copy link

We found that not enough information is provided about this issue.
Please provide details following the issue template.

@Raneem-MT Raneem-MT changed the title Please read & provide the following assert img.shape[:2] == (self.h, self.w) AssertionError Oct 30, 2024
@github-actions github-actions bot removed the needs-more-info More info is needed to complete the issue label Oct 30, 2024
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