Problem with empty bounding box
See original GitHub issue🐛 Bug
Sometimes during the training procedure I get:
ValueError: Expected target boxes to be a tensorof shape [N, 4], got torch.Size([0])
. It is caused by the transformation: train_tfms = tfms.A.Adapter([*tfms.A.aug_tfms(size=size, presize=presize), tfms.A.Normalize()])
. Sometimes tfms is for “aggressive” that it moves the image in such a way that no bbox is left. It crashes the training procedure
To Reproduce Steps to reproduce the behavior:
- Create the dataset, Wheat is fine for this
- Apply tfms such as:
train_tfms = tfms.A.Adapter([*tfms.A.aug_tfms(size=size, presize=presize), tfms.A.Normalize()])
- Set
faster_rcnn
as model - Run pytorch lightning training
- At some random (since aug_tfms is random) point the training will crash.
Expected behavior
The training shouldn’t crash, such step should be handled by the training_step/validation_step
in the lightning_module or at the model level
Desktop (please complete the following information): Happens both at kaggle notebooks and at colab
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Bounding Box Not Drawn/Some Variables Are Empty
Even though you have loaded and trained on the data without error, the reason your bounding box shows empty is because during testing...
Read more >Problem with empty bounding box · Issue #328
In Wheat dataset it is a case for img with imageid = 2507 (See attached screen). It is rare for this dataset but...
Read more >BoundingBox empty when creating a new level
When you are creating new views the section box bounding box doesn't exist so new bounding box with correctly ordered max/min can be...
Read more >Unwanted bounding box - Illustrator
I have an empty bounding box on my screen that attaches itself to any object/layer I choose. It won't delete and it doesn't...
Read more >google vision API returns empty bounding box vertexes ...
why the vertices structure is empty? I am following this article, and the author there uses vertices , but I don't understand why...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In Wheat dataset it is a case for img with imageid = 2507 (See attached screen). It is rare for this dataset but happens and crashes training.
You can find such situation in your dataset by runnign simple loop
If not at first time, then try a few times more (since crop is random)
You can chceck out my notebook, hope it helps you reproduce the error
Yeah solved 😃