{
  "id": 393247,
  "title": "Submission Scoring Error with Pruning ",
  "url": "/competitions/asl-signs/discussion/393247",
  "author_name": "",
  "post_date": "2023-03-08T15:38:46.142178100Z",
  "votes": 1,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Hi to all! <br>\nHas anyone tried using Pruning to reduce the model size?</p>\n<p>From the documentation(<a href=\"https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras):\" target=\"_blank\">https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras):</a><br>\nMagnitude-based weight pruning gradually zeroes out model weights during the training process to achieve model sparsity. Sparse models are easier to compress, and we can skip the zeroes during inference for latency improvements.</p>\n<p>This technique brings improvements via model compression. In the future, framework support for this technique will provide latency improvements. We've seen up to 6x improvements in model compression with minimal loss of accuracy.</p>\n<p>The technique is being evaluated in various speech applications, such as speech recognition and text-to-speech, and has been experimented on across various vision and translation models.</p>\n<p>I tried to apply this model but I get Submission Scoring Error. <br>\nAt first glance, the model works correctly.</p>",
  "messages": [
    {
      "id": "2173727",
      "postDate": "03/08/2023 15:38:46",
      "content": "<p>Hi to all! <br>\nHas anyone tried using Pruning to reduce the model size?</p>\n<p>From the documentation(<a href=\"https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras):\" target=\"_blank\">https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras):</a><br>\nMagnitude-based weight pruning gradually zeroes out model weights during the training process to achieve model sparsity. Sparse models are easier to compress, and we can skip the zeroes during inference for latency improvements.</p>\n<p>This technique brings improvements via model compression. In the future, framework support for this technique will provide latency improvements. We've seen up to 6x improvements in model compression with minimal loss of accuracy.</p>\n<p>The technique is being evaluated in various speech applications, such as speech recognition and text-to-speech, and has been experimented on across various vision and translation models.</p>\n<p>I tried to apply this model but I get Submission Scoring Error. <br>\nAt first glance, the model works correctly.</p>",
      "rawMarkdown": "Hi to all! \nHas anyone tried using Pruning to reduce the model size?\n\nFrom the documentation(https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras):\nMagnitude-based weight pruning gradually zeroes out model weights during the training process to achieve model sparsity. Sparse models are easier to compress, and we can skip the zeroes during inference for latency improvements.\n\nThis technique brings improvements via model compression. In the future, framework support for this technique will provide latency improvements. We've seen up to 6x improvements in model compression with minimal loss of accuracy.\n\nThe technique is being evaluated in various speech applications, such as speech recognition and text-to-speech, and has been experimented on across various vision and translation models.\n\nI tried to apply this model but I get Submission Scoring Error. \nAt first glance, the model works correctly.",
      "votes": null
    },
    {
      "id": "2173844",
      "postDate": "03/08/2023 17:21:53",
      "content": "<p>Here is my code: <a href=\"https://www.kaggle.com/aikhmelnytskyy/gislr-tf-on-the-shoulders-pruning-error\" target=\"_blank\">https://www.kaggle.com/aikhmelnytskyy/gislr-tf-on-the-shoulders-pruning-error</a></p>",
      "rawMarkdown": "Here is my code: https://www.kaggle.com/aikhmelnytskyy/gislr-tf-on-the-shoulders-pruning-error",
      "votes": null
    },
    {
      "id": "2174052",
      "postDate": "03/08/2023 20:05:26",
      "content": "<p>So no warning messages of any kind printed when converting to tflite?</p>\n<p>I wonder if the model optimization in some way conflicts with the model optimization built into tflite?</p>",
      "rawMarkdown": "So no warning messages of any kind printed when converting to tflite?\n\nI wonder if the model optimization in some way conflicts with the model optimization built into tflite?",
      "votes": null
    },
    {
      "id": "2174419",
      "postDate": "03/09/2023 05:37:35",
      "content": "<p>If you look at the notebook that I published with the error, you will see that at first glance the model works. I assume there may be a problem in my code, but I can't see where. In addition, the pruning pattern in tf provides for further use of tflite. I used the example from the official website as a basis</p>",
      "rawMarkdown": "If you look at the notebook that I published with the error, you will see that at first glance the model works. I assume there may be a problem in my code, but I can't see where. In addition, the pruning pattern in tf provides for further use of tflite. I used the example from the official website as a basis",
      "votes": null
    },
    {
      "id": "2187581",
      "postDate": "03/18/2023 20:55:13",
      "content": "<p>has anyone verified that prunning can work for the submission?<br>\nif so i would like to switch to tf training framwework.</p>",
      "rawMarkdown": "has anyone verified that prunning can work for the submission?\nif so i would like to switch to tf training framwework.",
      "votes": null
    },
    {
      "id": "2188475",
      "postDate": "03/19/2023 17:02:18",
      "content": "<p>I tried pruning. The problem with pruning is that it reduces my CV from 0.74 to 0.7. Plus it reduces the size of the zip, but the size of the unzipped model is still large, that is, it improves the compression, but not enough, in my case Dynamic range quantization worked better, I wrote about it in this discussion <a href=\"https://www.kaggle.com/competitions/\" target=\"_blank\">https://www.kaggle.com/competitions/</a> asl-signs/discussion/394371</p>",
      "rawMarkdown": "I tried pruning. The problem with pruning is that it reduces my CV from 0.74 to 0.7. Plus it reduces the size of the zip, but the size of the unzipped model is still large, that is, it improves the compression, but not enough, in my case Dynamic range quantization worked better, I wrote about it in this discussion https://www.kaggle.com/competitions/ asl-signs/discussion/394371",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2173844,
      "author_name": "aikhmelnytskyy",
      "author_url": "",
      "post_date": "03/08/2023 17:21:53",
      "content": "<p>Here is my code: <a href=\"https://www.kaggle.com/aikhmelnytskyy/gislr-tf-on-the-shoulders-pruning-error\" target=\"_blank\">https://www.kaggle.com/aikhmelnytskyy/gislr-tf-on-the-shoulders-pruning-error</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2174052,
      "author_name": "roberthatch",
      "author_url": "",
      "post_date": "03/08/2023 20:05:26",
      "content": "<p>So no warning messages of any kind printed when converting to tflite?</p>\n<p>I wonder if the model optimization in some way conflicts with the model optimization built into tflite?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2174419,
          "author_name": "aikhmelnytskyy",
          "author_url": "",
          "post_date": "03/09/2023 05:37:35",
          "content": "<p>If you look at the notebook that I published with the error, you will see that at first glance the model works. I assume there may be a problem in my code, but I can't see where. In addition, the pruning pattern in tf provides for further use of tflite. I used the example from the official website as a basis</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2187581,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "03/18/2023 20:55:13",
      "content": "<p>has anyone verified that prunning can work for the submission?<br>\nif so i would like to switch to tf training framwework.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2188475,
          "author_name": "aikhmelnytskyy",
          "author_url": "",
          "post_date": "03/19/2023 17:02:18",
          "content": "<p>I tried pruning. The problem with pruning is that it reduces my CV from 0.74 to 0.7. Plus it reduces the size of the zip, but the size of the unzipped model is still large, that is, it improves the compression, but not enough, in my case Dynamic range quantization worked better, I wrote about it in this discussion <a href=\"https://www.kaggle.com/competitions/\" target=\"_blank\">https://www.kaggle.com/competitions/</a> asl-signs/discussion/394371</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2173727": "Hi to all! \nHas anyone tried using Pruning to reduce the model size?\n\nFrom the documentation(https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras):\nMagnitude-based weight pruning gradually zeroes out model weights during the training process to achieve model sparsity. Sparse models are easier to compress, and we can skip the zeroes during inference for latency improvements.\n\nThis technique brings improvements via model compression. In the future, framework support for this technique will provide latency improvements. We've seen up to 6x improvements in model compression with minimal loss of accuracy.\n\nThe technique is being evaluated in various speech applications, such as speech recognition and text-to-speech, and has been experimented on across various vision and translation models.\n\nI tried to apply this model but I get Submission Scoring Error. \nAt first glance, the model works correctly.",
    "2173844": "Here is my code: https://www.kaggle.com/aikhmelnytskyy/gislr-tf-on-the-shoulders-pruning-error",
    "2174052": "So no warning messages of any kind printed when converting to tflite?\n\nI wonder if the model optimization in some way conflicts with the model optimization built into tflite?",
    "2174419": "If you look at the notebook that I published with the error, you will see that at first glance the model works. I assume there may be a problem in my code, but I can't see where. In addition, the pruning pattern in tf provides for further use of tflite. I used the example from the official website as a basis",
    "2187581": "has anyone verified that prunning can work for the submission?\nif so i would like to switch to tf training framwework.",
    "2188475": "I tried pruning. The problem with pruning is that it reduces my CV from 0.74 to 0.7. Plus it reduces the size of the zip, but the size of the unzipped model is still large, that is, it improves the compression, but not enough, in my case Dynamic range quantization worked better, I wrote about it in this discussion https://www.kaggle.com/competitions/ asl-signs/discussion/394371"
  },
  "source": "meta"
}