question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All bounding boxes should have positive height and width

See original GitHub issue

Describe the bug I created a dataset that already worked with TensorFlow. For some reason, it raises this error when trying to train a model.

Code and Data `from detecto import core, utils, visualize

dataset = core.Dataset(‘analyzepage/’) model = core.Model([‘taskRegion’, ‘pageCount’, ‘infoText’, ‘separateImage’, ‘element’])

model.fit(dataset)`

Environment:

  • OS: Windows 10
  • Python version: 3.6
  • Detecto version: 1.1.6
  • torch version: -
  • torchvision version: -

Additional context Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Esraanageh22commented, Mar 23, 2022

oh finally it worked thank you!

1reaction
alankbicommented, Mar 23, 2022

Looks like I made a mistake in my script, my bad - try this instead:

for i in range(len(dataset)):
    image, target = dataset[i]
    boxes = target['boxes']
    for box in boxes:
        if box[0] >= box[2] or box[1] >= box[3]: # min x > max x or min y > max y
            print(i, box)
Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: All bounding boxes should have positive height ...
ValueError: All bounding boxes should have positive height and width. Found invaid box [500.728515625, 533.3333129882812, 231.10546875, 255.2083282470703] ...
Read more >
I am getting a ValueError: All bounding boxes should have ...
ValueError: All bounding boxes should have positive height and width. Found invaid box [264.0, 632.0, 264.0, 633.3333740234375] for target ...
Read more >
bounding boxes should have positive height and width. Found ...
Hey I am getting the error ValueError: All bounding boxes should have positive height and width. Found invaid box [264.0, 632.0, 264.0, ...
Read more >
ValueError: All bounding boxes should have positive height ...
python - ValueError: All bounding boxes should have positive height and width. Any help solving this will be highly appreciated. I have an ......
Read more >
Found invalid box [776.5625, 137.5, 776.5625, 143.75 ... - Zindi
ValueError: All bounding boxes should have positive height and width. Found invalid box [776.5625, 137.5, 776.5625, 143.75] for target at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found