{
  "id": 412672,
  "title": "Installing pycocotools in submission",
  "url": "/competitions/hubmap-hacking-the-human-vasculature/discussion/412672",
  "author_name": "",
  "post_date": "2023-05-24T18:46:30.020307200Z",
  "votes": 2,
  "comment_count": 9,
  "views": 0,
  "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>\n<p>Hello,</p>\n<p>Does anyone know how to import pycocotools without internet? I have to install it with the notebook access to internet but the submission does not allow internet access.</p>\n<p>Seems like we need this package as suggested in the evaluation function example to convert a segmentation map to the correct format.</p>",
  "messages": [
    {
      "id": "2272795",
      "postDate": "05/24/2023 18:46:30",
      "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>\n<p>Hello,</p>\n<p>Does anyone know how to import pycocotools without internet? I have to install it with the notebook access to internet but the submission does not allow internet access.</p>\n<p>Seems like we need this package as suggested in the evaluation function example to convert a segmentation map to the correct format.</p>",
      "rawMarkdown": "ryanholbrook \n\nHello,\n\nDoes anyone know how to import pycocotools without internet? I have to install it with the notebook access to internet but the submission does not allow internet access.\n\nSeems like we need this package as suggested in the evaluation function example to convert a segmentation map to the correct format.",
      "votes": null
    },
    {
      "id": "2272854",
      "postDate": "05/24/2023 19:50:59",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/jonathanplante\" target=\"_blank\">@jonathanplante</a>,</p>\n<p>You can attach <code>pycocotools</code> as a dataset with your submission notebook. There are a number of datasets already on Kaggle that have it available. You could check out <a href=\"https://www.kaggle.com/code/dschettler8845/hpa-cellwise-classification-inference/notebook\" target=\"_blank\">this notebook</a> from a previous competition with the same metric for an example.</p>",
      "rawMarkdown": "Hi @jonathanplante,\n\nYou can attach `pycocotools` as a dataset with your submission notebook. There are a number of datasets already on Kaggle that have it available. You could check out [this notebook](https://www.kaggle.com/code/dschettler8845/hpa-cellwise-classification-inference/notebook) from a previous competition with the same metric for an example.",
      "votes": null
    },
    {
      "id": "2272897",
      "postDate": "05/24/2023 20:27:57",
      "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>\n<p>Thanks for your quick reply. I have tried that but i keep getting this error when installing:</p>\n<p>!pip install -q \"/kaggle/input/pycocotools/pycocotools-2.0-cp37-cp37m-linux_x86_64.whl\"</p>\n<p>ERROR: pycocotools-2.0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.</p>",
      "rawMarkdown": "ryanholbrook \n\nThanks for your quick reply. I have tried that but i keep getting this error when installing:\n\n!pip install -q \"/kaggle/input/pycocotools/pycocotools-2.0-cp37-cp37m-linux_x86_64.whl\"\n\nERROR: pycocotools-2.0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.",
      "votes": null
    },
    {
      "id": "2272902",
      "postDate": "05/24/2023 20:36:07",
      "content": "<p>The <code>cp37</code> makes me suspect that was compiled for Python 3.7, while our notebooks are now on 3.10. You might need to <a href=\"https://pip.pypa.io/en/stable/cli/pip_wheel/\" target=\"_blank\">create a new wheel</a>.</p>",
      "rawMarkdown": "The `cp37` makes me suspect that was compiled for Python 3.7, while our notebooks are now on 3.10. You might need to [create a new wheel](https://pip.pypa.io/en/stable/cli/pip_wheel/).",
      "votes": null
    },
    {
      "id": "2272946",
      "postDate": "05/24/2023 21:26:39",
      "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>\n<p>Thanks I have succeeded with that. However would it possible to know why my latest submission failed. I am trying to submit with a binary mask with a square for each picture.</p>\n<p>Thanks</p>",
      "rawMarkdown": "ryanholbrook \n\nThanks I have succeeded with that. However would it possible to know why my latest submission failed. I am trying to submit with a binary mask with a square for each picture.\n\nThanks",
      "votes": null
    },
    {
      "id": "2272959",
      "postDate": "05/24/2023 21:58:37",
      "content": "<p>I'm seeing <code>The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.</code></p>\n<p>It looks like the <code>prediction_string</code> might not be properly formatted. Could you share an example of what a row of your <code>submission.csv</code> looks like?</p>",
      "rawMarkdown": "I'm seeing `The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.`\n\nIt looks like the `prediction_string` might not be properly formatted. Could you share an example of what a row of your `submission.csv` looks like?",
      "votes": null
    },
    {
      "id": "2272977",
      "postDate": "05/24/2023 22:30:00",
      "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> it looks like this:<br>\nid    height  width   prediction_string<br>\n72e40acccadf    512 512 0 0.9 b'eNqLCjC1SrM3QAdp+anmAFhABmA='</p>",
      "rawMarkdown": "ryanholbrook it looks like this:\nid\theight\twidth\tprediction_string\n72e40acccadf\t512\t512\t0 0.9 b'eNqLCjC1SrM3QAdp+anmAFhABmA='",
      "votes": null
    },
    {
      "id": "2273767",
      "postDate": "05/25/2023 11:53:05",
      "content": "<p>Thanks! One row of the submission file should look like:<br>\n<code>72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=</code></p>\n<p>So:</p>\n<ul>\n<li>putting commas between fields, like: <code>id,height,width,prediction_string</code>, and,</li>\n<li>decoding the bytestring (the <code>b'...'</code> part) to an ordinary string, maybe with something like <code>x.decode('utf-8')</code>.</li>\n</ul>\n<p>If you have multiple instances for the same image, just concatenate their prediction strings (delimiting by a space), like:</p>\n<p><code>72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA= 0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=</code></p>",
      "rawMarkdown": "Thanks! One row of the submission file should look like:\n`72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=`\n\nSo:\n- putting commas between fields, like: `id,height,width,prediction_string`, and,\n- decoding the bytestring (the `b'...'` part) to an ordinary string, maybe with something like `x.decode('utf-8')`.\n\nIf you have multiple instances for the same image, just concatenate their prediction strings (delimiting by a space), like:\n\n`72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA= 0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=`",
      "votes": null
    },
    {
      "id": "2273799",
      "postDate": "05/25/2023 12:16:29",
      "content": "<p>thank you!</p>",
      "rawMarkdown": "thank you!",
      "votes": null
    },
    {
      "id": "2277672",
      "postDate": "05/28/2023 00:51:10",
      "content": "<p>Hello. I'm new to Kaggle.</p>\n<p>So, to install some packages to the final notebook, I can use a \"duct tape\" -  packages saved in datasets.</p>\n<p>But how about weights? Is it not possible to make a submission using a model trained during the interactive session of the notebook? This is because the working directory is not persistent when using \"save &amp; run all.\"</p>\n<p>Should I retrain the model on the GPU every time I make a submission and \"save &amp; run all\"?</p>",
      "rawMarkdown": "Hello. I'm new to Kaggle.\n\nSo, to install some packages to the final notebook, I can use a \"duct tape\" -  packages saved in datasets.\n\nBut how about weights? Is it not possible to make a submission using a model trained during the interactive session of the notebook? This is because the working directory is not persistent when using \"save & run all.\"\n\nShould I retrain the model on the GPU every time I make a submission and \"save & run all\"?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2272854,
      "author_name": "ryanholbrook",
      "author_url": "",
      "post_date": "05/24/2023 19:50:59",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/jonathanplante\" target=\"_blank\">@jonathanplante</a>,</p>\n<p>You can attach <code>pycocotools</code> as a dataset with your submission notebook. There are a number of datasets already on Kaggle that have it available. You could check out <a href=\"https://www.kaggle.com/code/dschettler8845/hpa-cellwise-classification-inference/notebook\" target=\"_blank\">this notebook</a> from a previous competition with the same metric for an example.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2272897,
          "author_name": "jonathanplante",
          "author_url": "",
          "post_date": "05/24/2023 20:27:57",
          "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>\n<p>Thanks for your quick reply. I have tried that but i keep getting this error when installing:</p>\n<p>!pip install -q \"/kaggle/input/pycocotools/pycocotools-2.0-cp37-cp37m-linux_x86_64.whl\"</p>\n<p>ERROR: pycocotools-2.0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2272902,
              "author_name": "ryanholbrook",
              "author_url": "",
              "post_date": "05/24/2023 20:36:07",
              "content": "<p>The <code>cp37</code> makes me suspect that was compiled for Python 3.7, while our notebooks are now on 3.10. You might need to <a href=\"https://pip.pypa.io/en/stable/cli/pip_wheel/\" target=\"_blank\">create a new wheel</a>.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2272946,
                  "author_name": "jonathanplante",
                  "author_url": "",
                  "post_date": "05/24/2023 21:26:39",
                  "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>\n<p>Thanks I have succeeded with that. However would it possible to know why my latest submission failed. I am trying to submit with a binary mask with a square for each picture.</p>\n<p>Thanks</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2272959,
                      "author_name": "ryanholbrook",
                      "author_url": "",
                      "post_date": "05/24/2023 21:58:37",
                      "content": "<p>I'm seeing <code>The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.</code></p>\n<p>It looks like the <code>prediction_string</code> might not be properly formatted. Could you share an example of what a row of your <code>submission.csv</code> looks like?</p>",
                      "votes": null,
                      "replies": [
                        {
                          "id": 2272977,
                          "author_name": "jonathanplante",
                          "author_url": "",
                          "post_date": "05/24/2023 22:30:00",
                          "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> it looks like this:<br>\nid    height  width   prediction_string<br>\n72e40acccadf    512 512 0 0.9 b'eNqLCjC1SrM3QAdp+anmAFhABmA='</p>",
                          "votes": null,
                          "replies": [
                            {
                              "id": 2273767,
                              "author_name": "ryanholbrook",
                              "author_url": "",
                              "post_date": "05/25/2023 11:53:05",
                              "content": "<p>Thanks! One row of the submission file should look like:<br>\n<code>72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=</code></p>\n<p>So:</p>\n<ul>\n<li>putting commas between fields, like: <code>id,height,width,prediction_string</code>, and,</li>\n<li>decoding the bytestring (the <code>b'...'</code> part) to an ordinary string, maybe with something like <code>x.decode('utf-8')</code>.</li>\n</ul>\n<p>If you have multiple instances for the same image, just concatenate their prediction strings (delimiting by a space), like:</p>\n<p><code>72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA= 0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=</code></p>",
                              "votes": null,
                              "replies": [
                                {
                                  "id": 2273799,
                                  "author_name": "jonathanplante",
                                  "author_url": "",
                                  "post_date": "05/25/2023 12:16:29",
                                  "content": "<p>thank you!</p>",
                                  "votes": null,
                                  "replies": []
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "id": 2277672,
          "author_name": "tsobolev",
          "author_url": "",
          "post_date": "05/28/2023 00:51:10",
          "content": "<p>Hello. I'm new to Kaggle.</p>\n<p>So, to install some packages to the final notebook, I can use a \"duct tape\" -  packages saved in datasets.</p>\n<p>But how about weights? Is it not possible to make a submission using a model trained during the interactive session of the notebook? This is because the working directory is not persistent when using \"save &amp; run all.\"</p>\n<p>Should I retrain the model on the GPU every time I make a submission and \"save &amp; run all\"?</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2272795": "ryanholbrook \n\nHello,\n\nDoes anyone know how to import pycocotools without internet? I have to install it with the notebook access to internet but the submission does not allow internet access.\n\nSeems like we need this package as suggested in the evaluation function example to convert a segmentation map to the correct format.",
    "2272854": "Hi @jonathanplante,\n\nYou can attach `pycocotools` as a dataset with your submission notebook. There are a number of datasets already on Kaggle that have it available. You could check out [this notebook](https://www.kaggle.com/code/dschettler8845/hpa-cellwise-classification-inference/notebook) from a previous competition with the same metric for an example.",
    "2272897": "ryanholbrook \n\nThanks for your quick reply. I have tried that but i keep getting this error when installing:\n\n!pip install -q \"/kaggle/input/pycocotools/pycocotools-2.0-cp37-cp37m-linux_x86_64.whl\"\n\nERROR: pycocotools-2.0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.",
    "2272902": "The `cp37` makes me suspect that was compiled for Python 3.7, while our notebooks are now on 3.10. You might need to [create a new wheel](https://pip.pypa.io/en/stable/cli/pip_wheel/).",
    "2272946": "ryanholbrook \n\nThanks I have succeeded with that. However would it possible to know why my latest submission failed. I am trying to submit with a binary mask with a square for each picture.\n\nThanks",
    "2272959": "I'm seeing `The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.`\n\nIt looks like the `prediction_string` might not be properly formatted. Could you share an example of what a row of your `submission.csv` looks like?",
    "2272977": "ryanholbrook it looks like this:\nid\theight\twidth\tprediction_string\n72e40acccadf\t512\t512\t0 0.9 b'eNqLCjC1SrM3QAdp+anmAFhABmA='",
    "2273767": "Thanks! One row of the submission file should look like:\n`72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=`\n\nSo:\n- putting commas between fields, like: `id,height,width,prediction_string`, and,\n- decoding the bytestring (the `b'...'` part) to an ordinary string, maybe with something like `x.decode('utf-8')`.\n\nIf you have multiple instances for the same image, just concatenate their prediction strings (delimiting by a space), like:\n\n`72e40acccadf,512,512,0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA= 0 0.9 eNqLCjC1SrM3QAdp+anmAFhABmA=`",
    "2273799": "thank you!",
    "2277672": "Hello. I'm new to Kaggle.\n\nSo, to install some packages to the final notebook, I can use a \"duct tape\" -  packages saved in datasets.\n\nBut how about weights? Is it not possible to make a submission using a model trained during the interactive session of the notebook? This is because the working directory is not persistent when using \"save & run all.\"\n\nShould I retrain the model on the GPU every time I make a submission and \"save & run all\"?"
  },
  "source": "meta"
}