{
  "id": 290057,
  "title": "Pure Pytorch FasterR-CNN Starter [LB=0.416]",
  "url": "/competitions/tensorflow-great-barrier-reef/discussion/290057",
  "author_name": "",
  "post_date": "2021-11-23T00:54:52.878176200Z",
  "votes": 24,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Hello community,</p>\n<p>I just finished adapting a version of the Faster R-CNN mentioned by <a href=\"https://www.kaggle.com/usharengaraju\" target=\"_blank\">@usharengaraju</a> (Tensor Girl) in <a href=\"https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290016\" target=\"_blank\">this discussion topic</a>.</p>\n<p>As of the current version, it has a validation schema based on \"subsequences (see <a href=\"https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290235\" target=\"_blank\">this topic</a> about validation schemas).</p>\n<p>It's a full pipeline using purely pytorch and torchvision, so I hope it's interesting for the community and it serves as a good kick-starter for some of you.</p>\n<p>It has a <code>LB=0.416</code></p>\n<h3>Training notebook:  <a href=\"https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-train\" target=\"_blank\">🐠 Reef - Starter Pytorch FasterRCNN Train [LB=0.413]</a></h3>\n<h3>Inference notebook: <a href=\"https://www.kaggle.com/julian3833/coral-reef-pytorch-fasterrcnn-infer-0-xxx\" target=\"_blank\">🐠 Reef - Starter Pytorch FasterRCNN Infer [LB=0.413]</a></h3>\n<h3>Weights: <a href=\"https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-weights\" target=\"_blank\">coral-reef-pytorch-starter-fasterrcnn-weights</a></h3>",
  "messages": [
    {
      "id": "1592199",
      "postDate": "11/23/2021 00:54:52",
      "content": "<p>Hello community,</p>\n<p>I just finished adapting a version of the Faster R-CNN mentioned by <a href=\"https://www.kaggle.com/usharengaraju\" target=\"_blank\">@usharengaraju</a> (Tensor Girl) in <a href=\"https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290016\" target=\"_blank\">this discussion topic</a>.</p>\n<p>As of the current version, it has a validation schema based on \"subsequences (see <a href=\"https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290235\" target=\"_blank\">this topic</a> about validation schemas).</p>\n<p>It's a full pipeline using purely pytorch and torchvision, so I hope it's interesting for the community and it serves as a good kick-starter for some of you.</p>\n<p>It has a <code>LB=0.416</code></p>\n<h3>Training notebook:  <a href=\"https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-train\" target=\"_blank\">🐠 Reef - Starter Pytorch FasterRCNN Train [LB=0.413]</a></h3>\n<h3>Inference notebook: <a href=\"https://www.kaggle.com/julian3833/coral-reef-pytorch-fasterrcnn-infer-0-xxx\" target=\"_blank\">🐠 Reef - Starter Pytorch FasterRCNN Infer [LB=0.413]</a></h3>\n<h3>Weights: <a href=\"https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-weights\" target=\"_blank\">coral-reef-pytorch-starter-fasterrcnn-weights</a></h3>",
      "rawMarkdown": "Hello community,\n\nI just finished adapting a version of the Faster R-CNN mentioned by @usharengaraju (Tensor Girl) in [this discussion topic](https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290016).\n\nAs of the current version, it has a validation schema based on \"subsequences (see [this topic](https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290235) about validation schemas).\n\nIt's a full pipeline using purely pytorch and torchvision, so I hope it's interesting for the community and it serves as a good kick-starter for some of you.\n\nIt has a `LB=0.416`\n\n### Training notebook:  [🐠 Reef - Starter Pytorch FasterRCNN Train [LB=0.413]](https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-train)\n\n### Inference notebook: [🐠 Reef - Starter Pytorch FasterRCNN Infer [LB=0.413]](https://www.kaggle.com/julian3833/coral-reef-pytorch-fasterrcnn-infer-0-xxx)\n\n### Weights: [coral-reef-pytorch-starter-fasterrcnn-weights](https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-weights)",
      "votes": null
    },
    {
      "id": "1592586",
      "postDate": "11/23/2021 07:23:10",
      "content": "<p>Greate notebook! Thank you for sharing!<br>\nCould I ask you a nowise question - why pytroch FasterRCNN does not trainable on images without BBs?</p>",
      "rawMarkdown": "Greate notebook! Thank you for sharing!\nCould I ask you a nowise question - why pytroch FasterRCNN does not trainable on images without BBs?",
      "votes": null
    },
    {
      "id": "1593181",
      "postDate": "11/23/2021 17:35:10",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/meowmeowmeowmeowmeow\" target=\"_blank\">@meowmeowmeowmeowmeow</a> thanks for commenting and upvoting.</p>\n<p>It seems like a problem that is deeply rooted and might not be trivially addressable. When I add samples with no annotations, I get the following error:</p>\n<pre><code>ValueError: No ground-truth boxes available for one of the images during training\n</code></pre>\n<p>It looks like they are just plainly not supported by the architecture. </p>\n<p>On the other hand, I have seen that the other starters are dropping the images with no annotations as well, so it might be a common condition of objects detection models. </p>\n<p>I don't know much so take what I'm saying with a grain of salt.</p>",
      "rawMarkdown": "Hi @meowmeowmeowmeowmeow thanks for commenting and upvoting.\n\nIt seems like a problem that is deeply rooted and might not be trivially addressable. When I add samples with no annotations, I get the following error:\n\n```python\nValueError: No ground-truth boxes available for one of the images during training\n```\n\nIt looks like they are just plainly not supported by the architecture. \n\nOn the other hand, I have seen that the other starters are dropping the images with no annotations as well, so it might be a common condition of objects detection models. \n\nI don't know much so take what I'm saying with a grain of salt.",
      "votes": null
    },
    {
      "id": "1593307",
      "postDate": "11/23/2021 18:59:55",
      "content": "<p>Thank you for the replay. I am actually pretty noob in object detection, do you know more elegant way of solving this problem rather than just dropping ?</p>",
      "rawMarkdown": "Thank you for the replay. I am actually pretty noob in object detection, do you know more elegant way of solving this problem rather than just dropping ?",
      "votes": null
    },
    {
      "id": "1593668",
      "postDate": "11/24/2021 06:31:37",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/drhabib\" target=\"_blank\">@drhabib</a>, unluckily I'm a noob too and I don't. I will address the problem at some point though, but it's not a first priority since there are a lot of low-hanging fruits right now.</p>",
      "rawMarkdown": "Hi @drhabib, unluckily I'm a noob too and I don't. I will address the problem at some point though, but it's not a first priority since there are a lot of low-hanging fruits right now.",
      "votes": null
    },
    {
      "id": "1593944",
      "postDate": "11/24/2021 12:15:01",
      "content": "<p>It  requires tensorflow.    so how to convert the pretrained pytorch weights  to TF2 format?   </p>",
      "rawMarkdown": "It  requires tensorflow.    so how to convert the pretrained pytorch weights  to TF2 format?",
      "votes": null
    },
    {
      "id": "1594010",
      "postDate": "11/24/2021 13:16:58",
      "content": "<p>I have no practical experience with FasterRCNN (except one from detection), but I don't see any limitation by model architecture. If there is no annotation per sample, all proposed regions should be fined.<br>\nLooks like that limitation comes from PyTorch implementation. </p>",
      "rawMarkdown": "I have no practical experience with FasterRCNN (except one from detection), but I don't see any limitation by model architecture. If there is no annotation per sample, all proposed regions should be fined.\nLooks like that limitation comes from PyTorch implementation.",
      "votes": null
    },
    {
      "id": "1594454",
      "postDate": "11/24/2021 21:05:00",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/dragonzhang\" target=\"_blank\">@dragonzhang</a><br>\nTensorflow is required for the \"Performance prize\" only, for the LB prize anything goes. As I am more of a pytorch guy, my solutions will be on this side for now.</p>",
      "rawMarkdown": "Hi @dragonzhang\nTensorflow is required for the \"Performance prize\" only, for the LB prize anything goes. As I am more of a pytorch guy, my solutions will be on this side for now.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1592586,
      "author_name": "meowmeowmeowmeowmeow",
      "author_url": "",
      "post_date": "11/23/2021 07:23:10",
      "content": "<p>Greate notebook! Thank you for sharing!<br>\nCould I ask you a nowise question - why pytroch FasterRCNN does not trainable on images without BBs?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1593181,
          "author_name": "julian3833",
          "author_url": "",
          "post_date": "11/23/2021 17:35:10",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/meowmeowmeowmeowmeow\" target=\"_blank\">@meowmeowmeowmeowmeow</a> thanks for commenting and upvoting.</p>\n<p>It seems like a problem that is deeply rooted and might not be trivially addressable. When I add samples with no annotations, I get the following error:</p>\n<pre><code>ValueError: No ground-truth boxes available for one of the images during training\n</code></pre>\n<p>It looks like they are just plainly not supported by the architecture. </p>\n<p>On the other hand, I have seen that the other starters are dropping the images with no annotations as well, so it might be a common condition of objects detection models. </p>\n<p>I don't know much so take what I'm saying with a grain of salt.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1593307,
          "author_name": "drhabib",
          "author_url": "",
          "post_date": "11/23/2021 18:59:55",
          "content": "<p>Thank you for the replay. I am actually pretty noob in object detection, do you know more elegant way of solving this problem rather than just dropping ?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1593668,
          "author_name": "julian3833",
          "author_url": "",
          "post_date": "11/24/2021 06:31:37",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/drhabib\" target=\"_blank\">@drhabib</a>, unluckily I'm a noob too and I don't. I will address the problem at some point though, but it's not a first priority since there are a lot of low-hanging fruits right now.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1594010,
          "author_name": "meowmeowmeowmeowmeow",
          "author_url": "",
          "post_date": "11/24/2021 13:16:58",
          "content": "<p>I have no practical experience with FasterRCNN (except one from detection), but I don't see any limitation by model architecture. If there is no annotation per sample, all proposed regions should be fined.<br>\nLooks like that limitation comes from PyTorch implementation. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1593944,
      "author_name": "dragonzhang",
      "author_url": "",
      "post_date": "11/24/2021 12:15:01",
      "content": "<p>It  requires tensorflow.    so how to convert the pretrained pytorch weights  to TF2 format?   </p>",
      "votes": null,
      "replies": [
        {
          "id": 1594454,
          "author_name": "julian3833",
          "author_url": "",
          "post_date": "11/24/2021 21:05:00",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/dragonzhang\" target=\"_blank\">@dragonzhang</a><br>\nTensorflow is required for the \"Performance prize\" only, for the LB prize anything goes. As I am more of a pytorch guy, my solutions will be on this side for now.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1592199": "Hello community,\n\nI just finished adapting a version of the Faster R-CNN mentioned by @usharengaraju (Tensor Girl) in [this discussion topic](https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290016).\n\nAs of the current version, it has a validation schema based on \"subsequences (see [this topic](https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/290235) about validation schemas).\n\nIt's a full pipeline using purely pytorch and torchvision, so I hope it's interesting for the community and it serves as a good kick-starter for some of you.\n\nIt has a `LB=0.416`\n\n### Training notebook:  [🐠 Reef - Starter Pytorch FasterRCNN Train [LB=0.413]](https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-train)\n\n### Inference notebook: [🐠 Reef - Starter Pytorch FasterRCNN Infer [LB=0.413]](https://www.kaggle.com/julian3833/coral-reef-pytorch-fasterrcnn-infer-0-xxx)\n\n### Weights: [coral-reef-pytorch-starter-fasterrcnn-weights](https://www.kaggle.com/julian3833/coral-reef-pytorch-starter-fasterrcnn-weights)",
    "1592586": "Greate notebook! Thank you for sharing!\nCould I ask you a nowise question - why pytroch FasterRCNN does not trainable on images without BBs?",
    "1593181": "Hi @meowmeowmeowmeowmeow thanks for commenting and upvoting.\n\nIt seems like a problem that is deeply rooted and might not be trivially addressable. When I add samples with no annotations, I get the following error:\n\n```python\nValueError: No ground-truth boxes available for one of the images during training\n```\n\nIt looks like they are just plainly not supported by the architecture. \n\nOn the other hand, I have seen that the other starters are dropping the images with no annotations as well, so it might be a common condition of objects detection models. \n\nI don't know much so take what I'm saying with a grain of salt.",
    "1593307": "Thank you for the replay. I am actually pretty noob in object detection, do you know more elegant way of solving this problem rather than just dropping ?",
    "1593668": "Hi @drhabib, unluckily I'm a noob too and I don't. I will address the problem at some point though, but it's not a first priority since there are a lot of low-hanging fruits right now.",
    "1593944": "It  requires tensorflow.    so how to convert the pretrained pytorch weights  to TF2 format?",
    "1594010": "I have no practical experience with FasterRCNN (except one from detection), but I don't see any limitation by model architecture. If there is no annotation per sample, all proposed regions should be fined.\nLooks like that limitation comes from PyTorch implementation.",
    "1594454": "Hi @dragonzhang\nTensorflow is required for the \"Performance prize\" only, for the LB prize anything goes. As I am more of a pytorch guy, my solutions will be on this side for now."
  },
  "source": "meta"
}