PyTorch standard Coco dataset (datasets.CocoDetection) not compatible with Faster R-CNN object detection model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 7.3k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 13
Description
🐛 Describe the bug
Hi,
I am trying to train and evaluate pre-trained Faster R-CNN model with standard coco dataset. I am getting the following error
TypeError: RandomIoUCrop() requires input sample to contain tensor or PIL images and bounding boxes. Sample can also contain masks.
Here are the high level steps
- Downloaded the COCO 2017 dataset
- Prepared PyTorch dataset using standard steps from https://pytorch.org/vision/main/auto_examples/transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py
- Training and evaluating Faster R-CNN model using steps from https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
Here is colab notebook
https://colab.research.google.com/drive/1Tbu2Thf-thn0lLG12dM3bq_BMZDihX2Y?usp=sharing
Any help will be appreciated. Thanks.
Versions
Hi,
I am trying to train and evaluate pre-trained Faster R-CNN model with standard coco dataset. I am getting the following error
TypeError: RandomIoUCrop() requires input sample to contain tensor or PIL images and bounding boxes. Sample can also contain masks.
Here are the high level steps
- Downloaded the COCO 2017 dataset
- Prepared PyTorch dataset using standard steps from https://pytorch.org/vision/main/auto_examples/transforms/plot_transforms_e2e.html#sphx-glr-auto-examples-transforms-plot-transforms-e2e-py
- Training and evaluating Faster R-CNN model using steps from https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
Here is colab notebook
https://colab.research.google.com/drive/1Tbu2Thf-thn0lLG12dM3bq_BMZDihX2Y?usp=sharing
Any help will be appreciated. Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure using the linked Colab notebook and trace the sample passed from datasets.CocoDetection through RandomIoUCrop into Faster R-CNN. Compare the transform example and detection tutorial to identify the expected image and bounding-box sample structure; done means standard COCO preparation runs through training and evaluation without the TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100