{
  "id": 493478,
  "title": "Speed up inference via ONNX",
  "url": "/competitions/birdclef-2024/discussion/493478",
  "author_name": "Koolo",
  "post_date": "2024-04-13T15:36:36.162000",
  "votes": 20,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I notice that the computation resource is limited in submissions (only CPU notebooks and &lt;= 2 hours). Therefore, faster inference may be necessary to apply some complex strategies. </p>\n<p>In this <a href=\"https://www.kaggle.com/code/zijiangyang1116/birdclef-24-inference-with-onnx\" target=\"_blank\">notebook</a>, ONNX is employed to speed up the inference (about x2-3 faster than the original version). Hope it is helpful for you. By the way, ONNX and OpenVINO are also popular in BirdCLEF 2023.</p>",
  "messages": [
    {
      "id": 2750338,
      "postDate": "2024-04-13T15:36:36.163Z",
      "content": "<p>I notice that the computation resource is limited in submissions (only CPU notebooks and &lt;= 2 hours). Therefore, faster inference may be necessary to apply some complex strategies. </p>\n<p>In this <a href=\"https://www.kaggle.com/code/zijiangyang1116/birdclef-24-inference-with-onnx\" target=\"_blank\">notebook</a>, ONNX is employed to speed up the inference (about x2-3 faster than the original version). Hope it is helpful for you. By the way, ONNX and OpenVINO are also popular in BirdCLEF 2023.</p>",
      "rawMarkdown": "I notice that the computation resource is limited in submissions (only CPU notebooks and <= 2 hours). Therefore, faster inference may be necessary to apply some complex strategies. \n\nIn this [notebook](https://www.kaggle.com/code/zijiangyang1116/birdclef-24-inference-with-onnx), ONNX is employed to speed up the inference (about x2-3 faster than the original version). Hope it is helpful for you. By the way, ONNX and OpenVINO are also popular in BirdCLEF 2023.",
      "votes": 20
    },
    {
      "id": 2824821,
      "postDate": "2024-05-20T04:33:40.527Z",
      "content": "<p>Hey <a href=\"https://www.kaggle.com/zijiangyang1116\" target=\"_blank\">@zijiangyang1116</a>, thanks for the resource. I tried using the same notebook with the efficientnet_b5 model but it was giving an OOM error while submission. </p>",
      "rawMarkdown": "Hey @zijiangyang1116, thanks for the resource. I tried using the same notebook with the efficientnet_b5 model but it was giving an OOM error while submission. ",
      "replies": [
        {
          "id": 2838738,
          "postDate": "2024-05-27T07:38:24.330Z",
          "content": "<p>The <code>BATCH_SIZE</code> is set to 64. Therefore, reducing it to 32 or lower may be necessary for efficientnet_b5.</p>",
          "rawMarkdown": "The `BATCH_SIZE` is set to 64. Therefore, reducing it to 32 or lower may be necessary for efficientnet_b5.",
          "votes": 1
        }
      ]
    },
    {
      "id": 2752476,
      "postDate": "2024-04-15T01:54:14.610Z",
      "content": "<p>Thank you for sharing your insights! I am trying to convert a TensorFlow model to ONNX, but I am experiencing errors during the conversion process (tf2onnx.convert.from_keras) due to incompatible library versions. Here are the versions I tried that led to errors:</p>\n<p>TensorFlow (tf): 2.15.0<br>\nTensorFlow IO (tfio): 0.35.0<br>\ntf2onnx: 1.16.1<br>\nONNX: 1.16.0<br>\nONNX Runtime: 1.17.3</p>",
      "rawMarkdown": "Thank you for sharing your insights! I am trying to convert a TensorFlow model to ONNX, but I am experiencing errors during the conversion process (tf2onnx.convert.from_keras) due to incompatible library versions. Here are the versions I tried that led to errors:\n\nTensorFlow (tf): 2.15.0\nTensorFlow IO (tfio): 0.35.0\ntf2onnx: 1.16.1\nONNX: 1.16.0\nONNX Runtime: 1.17.3"
    },
    {
      "id": 2847726,
      "postDate": "2024-05-31T16:52:21.133Z",
      "rawMarkdown": "",
      "isDeleted": true,
      "replies": [
        {
          "id": 2848821,
          "postDate": "2024-06-01T08:27:41.847Z",
          "content": "<p>Yes. The training is shared in <a href=\"https://www.kaggle.com/code/zijiangyang1116/birdclef-24-efficientnetb0-pytorch-train\" target=\"_blank\">this notebook</a>.</p>",
          "rawMarkdown": "Yes. The training is shared in [this notebook](https://www.kaggle.com/code/zijiangyang1116/birdclef-24-efficientnetb0-pytorch-train)."
        }
      ]
    },
    {
      "id": 2750429,
      "postDate": "2024-04-13T17:02:47.103Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2824821,
      "author_name": "Rishav dash",
      "author_url": "",
      "post_date": "2024-05-20T04:33:40.527000",
      "content": "<p>Hey <a href=\"https://www.kaggle.com/zijiangyang1116\" target=\"_blank\">@zijiangyang1116</a>, thanks for the resource. I tried using the same notebook with the efficientnet_b5 model but it was giving an OOM error while submission. </p>",
      "votes": 0,
      "replies": [
        {
          "id": 2838738,
          "author_name": "Koolo",
          "author_url": "",
          "post_date": "2024-05-27T07:38:24.330000",
          "content": "<p>The <code>BATCH_SIZE</code> is set to 64. Therefore, reducing it to 32 or lower may be necessary for efficientnet_b5.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2752476,
      "author_name": "kmn",
      "author_url": "",
      "post_date": "2024-04-15T01:54:14.610000",
      "content": "<p>Thank you for sharing your insights! I am trying to convert a TensorFlow model to ONNX, but I am experiencing errors during the conversion process (tf2onnx.convert.from_keras) due to incompatible library versions. Here are the versions I tried that led to errors:</p>\n<p>TensorFlow (tf): 2.15.0<br>\nTensorFlow IO (tfio): 0.35.0<br>\ntf2onnx: 1.16.1<br>\nONNX: 1.16.0<br>\nONNX Runtime: 1.17.3</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2847726,
      "author_name": "",
      "author_url": "",
      "post_date": "2024-05-31T16:52:21.133000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2848821,
          "author_name": "Koolo",
          "author_url": "",
          "post_date": "2024-06-01T08:27:41.847000",
          "content": "<p>Yes. The training is shared in <a href=\"https://www.kaggle.com/code/zijiangyang1116/birdclef-24-efficientnetb0-pytorch-train\" target=\"_blank\">this notebook</a>.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2750429,
      "author_name": "",
      "author_url": "",
      "post_date": "2024-04-13T17:02:47.103000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2750338": "I notice that the computation resource is limited in submissions (only CPU notebooks and <= 2 hours). Therefore, faster inference may be necessary to apply some complex strategies. \n\nIn this [notebook](https://www.kaggle.com/code/zijiangyang1116/birdclef-24-inference-with-onnx), ONNX is employed to speed up the inference (about x2-3 faster than the original version). Hope it is helpful for you. By the way, ONNX and OpenVINO are also popular in BirdCLEF 2023.",
    "2824821": "Hey @zijiangyang1116, thanks for the resource. I tried using the same notebook with the efficientnet_b5 model but it was giving an OOM error while submission. ",
    "2752476": "Thank you for sharing your insights! I am trying to convert a TensorFlow model to ONNX, but I am experiencing errors during the conversion process (tf2onnx.convert.from_keras) due to incompatible library versions. Here are the versions I tried that led to errors:\n\nTensorFlow (tf): 2.15.0\nTensorFlow IO (tfio): 0.35.0\ntf2onnx: 1.16.1\nONNX: 1.16.0\nONNX Runtime: 1.17.3",
    "2847726": "",
    "2750429": ""
  }
}