{
  "id": 170211,
  "title": "Yet-Another-EfficientDet-Pytorch",
  "url": "/competitions/global-wheat-detection/discussion/170211",
  "author_name": "",
  "post_date": "2020-07-26T21:41:26.856618900Z",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Has anyone tried this repo? <a href=\"https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch\">https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch</a></p>\n\n<p>I've just about got it running, and the model has fully non-zero non-na outputs 🙏🏾. But when I try to run the outputs through <a href=\"https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch/blob/99ba5d98e0aa5a83da843426742187b0b2b6f45b/efficientdet/loss.py#L27\">FocalLoss</a>, I get a <code>CUDA error: device-side assert triggered</code> segfault. Upon closer inspection, I see that for a batch size of 2, the outputs from the model are shaped:</p>\n\n<p>```\ndef forward(self, imgs, annotations, obj_list=None):\n    _, regression, classification, anchors = self.model(imgs)</p>\n\n<pre><code># regression: torch.Size([2, 49104, 4])\n# classification: torch.Size([2, 49104, 1])\n# anchors: torch.Size([1, 49104, 4])\n\n# BOOM:\ncls_loss, reg_loss = self.criterion(classification, regression, anchors, annotations)\n</code></pre>\n\n<p>```</p>\n\n<p>FWIW, the annotations (target) are shaped <code>torch.Size([2, 59, 5])</code>. This particular effdet implementation pads.</p>\n\n<p>Is it normal to have model outputs with those dimensions? I know some of these bbox detection nets regress out a bunch of locations, but I wanted to see if the issue was right here or perhaps somewhere else in my code.</p>",
  "messages": [
    {
      "id": "946824",
      "postDate": "07/26/2020 21:41:26",
      "content": "<p>Has anyone tried this repo? <a href=\"https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch\">https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch</a></p>\n\n<p>I've just about got it running, and the model has fully non-zero non-na outputs 🙏🏾. But when I try to run the outputs through <a href=\"https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch/blob/99ba5d98e0aa5a83da843426742187b0b2b6f45b/efficientdet/loss.py#L27\">FocalLoss</a>, I get a <code>CUDA error: device-side assert triggered</code> segfault. Upon closer inspection, I see that for a batch size of 2, the outputs from the model are shaped:</p>\n\n<p>```\ndef forward(self, imgs, annotations, obj_list=None):\n    _, regression, classification, anchors = self.model(imgs)</p>\n\n<pre><code># regression: torch.Size([2, 49104, 4])\n# classification: torch.Size([2, 49104, 1])\n# anchors: torch.Size([1, 49104, 4])\n\n# BOOM:\ncls_loss, reg_loss = self.criterion(classification, regression, anchors, annotations)\n</code></pre>\n\n<p>```</p>\n\n<p>FWIW, the annotations (target) are shaped <code>torch.Size([2, 59, 5])</code>. This particular effdet implementation pads.</p>\n\n<p>Is it normal to have model outputs with those dimensions? I know some of these bbox detection nets regress out a bunch of locations, but I wanted to see if the issue was right here or perhaps somewhere else in my code.</p>",
      "rawMarkdown": "Has anyone tried this repo? https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch\n\nI've just about got it running, and the model has fully non-zero non-na outputs 🙏🏾. But when I try to run the outputs through [FocalLoss](https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch/blob/99ba5d98e0aa5a83da843426742187b0b2b6f45b/efficientdet/loss.py#L27), I get a `CUDA error: device-side assert triggered` segfault. Upon closer inspection, I see that for a batch size of 2, the outputs from the model are shaped:\n\n```\ndef forward(self, imgs, annotations, obj_list=None):\n    _, regression, classification, anchors = self.model(imgs)\n    \n    # regression: torch.Size([2, 49104, 4])\n    # classification: torch.Size([2, 49104, 1])\n    # anchors: torch.Size([1, 49104, 4])\n    \n    # BOOM:\n    cls_loss, reg_loss = self.criterion(classification, regression, anchors, annotations)\n```\n\nFWIW, the annotations (target) are shaped `torch.Size([2, 59, 5])`. This particular effdet implementation pads.\n\nIs it normal to have model outputs with those dimensions? I know some of these bbox detection nets regress out a bunch of locations, but I wanted to see if the issue was right here or perhaps somewhere else in my code.",
      "votes": null
    },
    {
      "id": "946927",
      "postDate": "07/27/2020 00:28:55",
      "content": "<p>I don't think I had any such problems when I tried it.</p>",
      "rawMarkdown": "I don't think I had any such problems when I tried it.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 946927,
      "author_name": "jonykarki",
      "author_url": "",
      "post_date": "07/27/2020 00:28:55",
      "content": "<p>I don't think I had any such problems when I tried it.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "946824": "Has anyone tried this repo? https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch\n\nI've just about got it running, and the model has fully non-zero non-na outputs 🙏🏾. But when I try to run the outputs through [FocalLoss](https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch/blob/99ba5d98e0aa5a83da843426742187b0b2b6f45b/efficientdet/loss.py#L27), I get a `CUDA error: device-side assert triggered` segfault. Upon closer inspection, I see that for a batch size of 2, the outputs from the model are shaped:\n\n```\ndef forward(self, imgs, annotations, obj_list=None):\n    _, regression, classification, anchors = self.model(imgs)\n    \n    # regression: torch.Size([2, 49104, 4])\n    # classification: torch.Size([2, 49104, 1])\n    # anchors: torch.Size([1, 49104, 4])\n    \n    # BOOM:\n    cls_loss, reg_loss = self.criterion(classification, regression, anchors, annotations)\n```\n\nFWIW, the annotations (target) are shaped `torch.Size([2, 59, 5])`. This particular effdet implementation pads.\n\nIs it normal to have model outputs with those dimensions? I know some of these bbox detection nets regress out a bunch of locations, but I wanted to see if the issue was right here or perhaps somewhere else in my code.",
    "946927": "I don't think I had any such problems when I tried it."
  },
  "source": "meta"
}