{
  "id": 153899,
  "title": "Please Help me, 【ValueError: No ground-truth boxes available for one of the images during training】",
  "url": "/competitions/global-wheat-detection/discussion/153899",
  "author_name": "",
  "post_date": "2020-05-26T13:37:51.722194800Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I used FasterRCNN and got this error--\nPlease help me to solve it, Thanks.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3550804%2F5e7631d8c7f7d652ae24e49dbe89c415%2F111.PNG?generation=1590500246134889&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "862222",
      "postDate": "05/26/2020 13:37:51",
      "content": "<p>I used FasterRCNN and got this error--\nPlease help me to solve it, Thanks.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3550804%2F5e7631d8c7f7d652ae24e49dbe89c415%2F111.PNG?generation=1590500246134889&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "I used FasterRCNN and got this error--\nPlease help me to solve it, Thanks.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3550804%2F5e7631d8c7f7d652ae24e49dbe89c415%2F111.PNG?generation=1590500246134889&amp;alt=media)",
      "votes": null
    },
    {
      "id": "862225",
      "postDate": "05/26/2020 13:39:43",
      "content": "<p>This is because you use augmentations which can produce an image with no boxes. When loading data, you should check whether it has boxes. If no, either pick another example or pass torch.zeros((0, 4)) and the boxes</p>",
      "rawMarkdown": "This is because you use augmentations which can produce an image with no boxes. When loading data, you should check whether it has boxes. If no, either pick another example or pass torch.zeros((0, 4)) and the boxes",
      "votes": null
    },
    {
      "id": "862247",
      "postDate": "05/26/2020 13:55:12",
      "content": "<p>Thanks for your help. However I checked whether it has boxes.</p>\n\n<p>using:\n<code>\nif len(sample['bboxes']) &amp;gt; 0:\n    target['boxes'] = torch.tensor(sample['bboxes'], dtype=torch.float32)\nelse:\n    target['boxes'] = torch.zeros((0, 4))\n</code></p>",
      "rawMarkdown": "Thanks for your help. However I checked whether it has boxes.\n\n\nusing:\n```\nif len(sample['bboxes']) &gt; 0:\n    target['boxes'] = torch.tensor(sample['bboxes'], dtype=torch.float32)\nelse:\n    target['boxes'] = torch.zeros((0, 4))\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 862225,
      "author_name": "matthewmasters",
      "author_url": "",
      "post_date": "05/26/2020 13:39:43",
      "content": "<p>This is because you use augmentations which can produce an image with no boxes. When loading data, you should check whether it has boxes. If no, either pick another example or pass torch.zeros((0, 4)) and the boxes</p>",
      "votes": null,
      "replies": [
        {
          "id": 862247,
          "author_name": "zuguoqiang",
          "author_url": "",
          "post_date": "05/26/2020 13:55:12",
          "content": "<p>Thanks for your help. However I checked whether it has boxes.</p>\n\n<p>using:\n<code>\nif len(sample['bboxes']) &amp;gt; 0:\n    target['boxes'] = torch.tensor(sample['bboxes'], dtype=torch.float32)\nelse:\n    target['boxes'] = torch.zeros((0, 4))\n</code></p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "862222": "I used FasterRCNN and got this error--\nPlease help me to solve it, Thanks.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3550804%2F5e7631d8c7f7d652ae24e49dbe89c415%2F111.PNG?generation=1590500246134889&amp;alt=media)",
    "862225": "This is because you use augmentations which can produce an image with no boxes. When loading data, you should check whether it has boxes. If no, either pick another example or pass torch.zeros((0, 4)) and the boxes",
    "862247": "Thanks for your help. However I checked whether it has boxes.\n\n\nusing:\n```\nif len(sample['bboxes']) &gt; 0:\n    target['boxes'] = torch.tensor(sample['bboxes'], dtype=torch.float32)\nelse:\n    target['boxes'] = torch.zeros((0, 4))\n```"
  },
  "source": "meta"
}