{
  "id": 484156,
  "title": "How to match Kaggle env locally?",
  "url": "/competitions/hms-harmful-brain-activity-classification/discussion/484156",
  "author_name": "",
  "post_date": "2024-03-15T15:06:15.312469Z",
  "votes": 4,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I am asking this because I when pass identical input tensors through the same torch model, the predictions are different in each environment. For example, here are 2 predictions.</p>\n<pre><code># Kaggle\ntensor()\n\n# Local\ntensor()\n</code></pre>\n<p>The difference between the feature vectors (before the last fully connected layer) does not match.. </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5570735%2F2b981946403b854fd1d7b3d0e6d62fda%2Fa.JPG?generation=1710515242337621&amp;alt=media\"></p>\n<p>I typically use <a href=\"https://conda.io/projects/conda/en/latest/user-guide/getting-started.html\" target=\"_blank\">Conda</a> to setup a local environment, but not sure if I need additional tools like <a href=\"https://www.docker.com/\" target=\"_blank\">Docker</a> to make the environments match. Any tips/resources would be helpful!</p>",
  "messages": [
    {
      "id": "2698537",
      "postDate": "03/15/2024 15:06:15",
      "content": "<p>I am asking this because I when pass identical input tensors through the same torch model, the predictions are different in each environment. For example, here are 2 predictions.</p>\n<pre><code># Kaggle\ntensor()\n\n# Local\ntensor()\n</code></pre>\n<p>The difference between the feature vectors (before the last fully connected layer) does not match.. </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5570735%2F2b981946403b854fd1d7b3d0e6d62fda%2Fa.JPG?generation=1710515242337621&amp;alt=media\"></p>\n<p>I typically use <a href=\"https://conda.io/projects/conda/en/latest/user-guide/getting-started.html\" target=\"_blank\">Conda</a> to setup a local environment, but not sure if I need additional tools like <a href=\"https://www.docker.com/\" target=\"_blank\">Docker</a> to make the environments match. Any tips/resources would be helpful!</p>",
      "rawMarkdown": "I am asking this because I when pass identical input tensors through the same torch model, the predictions are different in each environment. For example, here are 2 predictions.\n\n```\n# Kaggle\ntensor([[0.0035, 0.0390, 0.0524, 0.7719, 0.1149, 0.0182],\n        [0.5673, 0.0208, 0.0104, 0.0033, 0.3737, 0.0246]])\n\n# Local\ntensor([[0.0025, 0.0612, 0.0358, 0.8052, 0.0884, 0.0069],\n        [0.7325, 0.0140, 0.0138, 0.0017, 0.2278, 0.0101]])\n```\nThe difference between the feature vectors (before the last fully connected layer) does not match.. \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5570735%2F2b981946403b854fd1d7b3d0e6d62fda%2Fa.JPG?generation=1710515242337621&alt=media)\n\nI typically use [Conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html) to setup a local environment, but not sure if I need additional tools like [Docker](https://www.docker.com/) to make the environments match. Any tips/resources would be helpful!",
      "votes": null
    },
    {
      "id": "2698769",
      "postDate": "03/15/2024 16:25:03",
      "content": "<p>The Kaggle notebook environment details are published here: <a href=\"https://github.com/Kaggle/docker-python\" target=\"_blank\">https://github.com/Kaggle/docker-python</a></p>\n<p>You will need Docker.</p>",
      "rawMarkdown": "The Kaggle notebook environment details are published here: https://github.com/Kaggle/docker-python\n\nYou will need Docker.",
      "votes": null
    },
    {
      "id": "2698779",
      "postDate": "03/15/2024 16:28:19",
      "content": "<p>Thank you!</p>",
      "rawMarkdown": "Thank you!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2698769,
      "author_name": "sohier",
      "author_url": "",
      "post_date": "03/15/2024 16:25:03",
      "content": "<p>The Kaggle notebook environment details are published here: <a href=\"https://github.com/Kaggle/docker-python\" target=\"_blank\">https://github.com/Kaggle/docker-python</a></p>\n<p>You will need Docker.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2698779,
          "author_name": "brendanartley",
          "author_url": "",
          "post_date": "03/15/2024 16:28:19",
          "content": "<p>Thank you!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2698537": "I am asking this because I when pass identical input tensors through the same torch model, the predictions are different in each environment. For example, here are 2 predictions.\n\n```\n# Kaggle\ntensor([[0.0035, 0.0390, 0.0524, 0.7719, 0.1149, 0.0182],\n        [0.5673, 0.0208, 0.0104, 0.0033, 0.3737, 0.0246]])\n\n# Local\ntensor([[0.0025, 0.0612, 0.0358, 0.8052, 0.0884, 0.0069],\n        [0.7325, 0.0140, 0.0138, 0.0017, 0.2278, 0.0101]])\n```\nThe difference between the feature vectors (before the last fully connected layer) does not match.. \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5570735%2F2b981946403b854fd1d7b3d0e6d62fda%2Fa.JPG?generation=1710515242337621&alt=media)\n\nI typically use [Conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html) to setup a local environment, but not sure if I need additional tools like [Docker](https://www.docker.com/) to make the environments match. Any tips/resources would be helpful!",
    "2698769": "The Kaggle notebook environment details are published here: https://github.com/Kaggle/docker-python\n\nYou will need Docker.",
    "2698779": "Thank you!"
  },
  "source": "meta"
}