{
  "id": 166437,
  "title": "fastai I cant see the submit button……",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/166437",
  "author_name": "TheStoneMX",
  "post_date": "2020-07-12T21:50:47.078000",
  "votes": 1,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Hi there all,</p>\n\n<p>I finally got the code to run on Kaggle servers, but now I am getting this error.</p>\n\n<p>I have read the other threads but I cant find a solution.....</p>\n\n<p>and they are saying that I have written a submit.csv file in order to see the submit button</p>\n\n<p>But I never get the submit button. </p>\n\n<p>~~\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)\nprint(df.head())\nprint()\nprint(df.isup_grade.value_counts())</p>\n\n<pre><code>   image_id data_provider  isup_grade gleason_score\n</code></pre>\n\n<p>0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~</p>",
  "messages": [
    {
      "id": 926686,
      "postDate": "2020-07-12T21:50:47.080Z",
      "content": "<p>Hi there all,</p>\n\n<p>I finally got the code to run on Kaggle servers, but now I am getting this error.</p>\n\n<p>I have read the other threads but I cant find a solution.....</p>\n\n<p>and they are saying that I have written a submit.csv file in order to see the submit button</p>\n\n<p>But I never get the submit button. </p>\n\n<p>~~\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)\nprint(df.head())\nprint()\nprint(df.isup_grade.value_counts())</p>\n\n<pre><code>   image_id data_provider  isup_grade gleason_score\n</code></pre>\n\n<p>0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~</p>",
      "rawMarkdown": "Hi there all,\n\nI finally got the code to run on Kaggle servers, but now I am getting this error.\n\nI have read the other threads but I cant find a solution.....\n\nand they are saying that I have written a submit.csv file in order to see the submit button\n\nBut I never get the submit button. \n\n~~\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)\nprint(df.head())\nprint()\nprint(df.isup_grade.value_counts())\n\n       image_id data_provider  isup_grade gleason_score\n0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~",
      "votes": 1
    },
    {
      "id": 929508,
      "postDate": "2020-07-14T17:58:46.863Z",
      "content": "<p>found the solution, for anyone that is using Fastai.</p>\n\n<p>1.- you have to create the models directory.\n      Path('./models').mkdir(exist_ok=True, parents=True)\n      !cp '../input/panda-models/saved.pth' './models/saved.pth'\n     saved.pth is the fastai model</p>\n\n<p>2.- then once you load it you need to delete de file and directory\n    learn.load('saved') \n    !rm './models/saved.pth'\n    !rmdir './models'</p>\n\n<p>Then the submission file will always be there.</p>",
      "rawMarkdown": "found the solution, for anyone that is using Fastai.\n\n1.- you have to create the models directory.\n      Path('./models').mkdir(exist_ok=True, parents=True)\n      !cp '../input/panda-models/saved.pth' './models/saved.pth'\n     saved.pth is the fastai model\n\n2.- then once you load it you need to delete de file and directory\n    learn.load('saved') \n    !rm './models/saved.pth'\n    !rmdir './models'\n\nThen the submission file will always be there."
    },
    {
      "id": 926817,
      "postDate": "2020-07-13T02:54:51Z",
      "content": "<p>You sure internet is off in your kernel (that's a prerequisite) ?</p>",
      "rawMarkdown": "You sure internet is off in your kernel (that's a prerequisite) ?",
      "replies": [
        {
          "id": 927516,
          "postDate": "2020-07-13T12:59:24.033Z",
          "content": "<p><a href=\"/kishupro\">@kishupro</a> yes it is off.</p>",
          "rawMarkdown": "@kishupro yes it is off."
        }
      ]
    },
    {
      "id": 926771,
      "postDate": "2020-07-13T01:27:17.230Z",
      "content": "<p>This is the code that writes to submission.csv file which I can see on my working directory, but i cant see the submit button...... \n~~~\ndata_dir = '../input/prostate-cancer-grade-assessment'\ndf_train = pd.read_csv(os.path.join(data_dir, 'train.csv'))\ndf_test = pd.read_csv(os.path.join(data_dir, 'test.csv'))\ndf_sub = pd.read_csv(os.path.join(data_dir, 'sample_submission.csv'))</p>\n\n<p>model_dir = ''\nimage_folder = os.path.join(data_dir, 'test_images/')\nimage_folder = image_folder if is_test else os.path.join(data_dir, 'train_images/')\nimage_folder\n'../input/prostate-cancer-grade-assessment/test_images/'\n.\n.\n.\n.\n.\n.\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)</p>\n\n<h1>sub.to_csv('submission.csv', index=False)</h1>\n\n<p>print(df.head())\nprint()</p>\n\n<h1>print(df.isup_grade.value_counts())</h1>\n\n<pre><code>   image_id data_provider  isup_grade gleason_score\n</code></pre>\n\n<p>0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~</p>\n\n<p>Thanks for the help om advance</p>",
      "rawMarkdown": "This is the code that writes to submission.csv file which I can see on my working directory, but i cant see the submit button...... \n~~~\ndata_dir = '../input/prostate-cancer-grade-assessment'\ndf_train = pd.read_csv(os.path.join(data_dir, 'train.csv'))\ndf_test = pd.read_csv(os.path.join(data_dir, 'test.csv'))\ndf_sub = pd.read_csv(os.path.join(data_dir, 'sample_submission.csv'))\n\nmodel_dir = ''\nimage_folder = os.path.join(data_dir, 'test_images/')\nimage_folder = image_folder if is_test else os.path.join(data_dir, 'train_images/')\nimage_folder\n'../input/prostate-cancer-grade-assessment/test_images/'\n.\n.\n.\n.\n.\n.\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)\n# sub.to_csv('submission.csv', index=False)\nprint(df.head())\nprint()\n# print(df.isup_grade.value_counts())\n\n       image_id data_provider  isup_grade gleason_score\n0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~\n\nThanks for the help om advance",
      "replies": [
        {
          "id": 927826,
          "postDate": "2020-07-13T15:43:48.910Z",
          "content": "<p>I tried this but now I get csv file not found.... </p>\n\n<p>~~~\nTEST_PATH = '/kaggle/input/prostate-cancer-grade-assessment/test_images'</p>\n\n<p>if os.path.exists(TEST_PATH):\n    dls = dBlock.dataloaders(df_test, bs=8)</p>\n\n<pre><code>learn = Learner(dls, get_model())\nlearn.load('saved') \n\ntest_dl = dls.test_dl(df_test)\n_,_, preds = learn.get_preds(dl=test_dl, with_decoded=True)\n\ndf_test[\"isup_grade\"] = preds\nsub = df_test[[\"image_id\",\"isup_grade\"]]\nsub.to_csv('submission.csv', index=False) \n</code></pre>\n\n<p>else:\n    df_train =  df_train.loc[:5]\n    dls = dBlock.dataloaders(df_train, bs=8)</p>\n\n<pre><code>learn = Learner(dls, get_model())\nlearn.load('saved') \n\ntrain_dl = dls.test_dl(df_train)\n_,_, preds = learn.get_preds(dl=train_dl, with_decoded=True)\n\ndf_train[\"isup_grade\"] = preds\nsub = df_train[[\"image_id\",\"isup_grade\"]]\nsub.to_csv('submission.csv', index=Fals\n</code></pre>\n\n<p>~~~</p>",
          "rawMarkdown": "I tried this but now I get csv file not found.... \n\n~~~\nTEST_PATH = '/kaggle/input/prostate-cancer-grade-assessment/test_images'\n\nif os.path.exists(TEST_PATH):\n    dls = dBlock.dataloaders(df_test, bs=8)\n\n    learn = Learner(dls, get_model())\n    learn.load('saved') \n\n    test_dl = dls.test_dl(df_test)\n    _,_, preds = learn.get_preds(dl=test_dl, with_decoded=True)\n\n    df_test[\"isup_grade\"] = preds\n    sub = df_test[[\"image_id\",\"isup_grade\"]]\n    sub.to_csv('submission.csv', index=False) \nelse:\n    df_train =  df_train.loc[:5]\n    dls = dBlock.dataloaders(df_train, bs=8)\n\n    learn = Learner(dls, get_model())\n    learn.load('saved') \n\n    train_dl = dls.test_dl(df_train)\n    _,_, preds = learn.get_preds(dl=train_dl, with_decoded=True)\n\n    df_train[\"isup_grade\"] = preds\n    sub = df_train[[\"image_id\",\"isup_grade\"]]\n    sub.to_csv('submission.csv', index=Fals\n~~~"
        }
      ]
    },
    {
      "id": 928070,
      "postDate": "2020-07-13T18:27:03.567Z",
      "rawMarkdown": "",
      "isDeleted": true,
      "replies": [
        {
          "id": 928130,
          "postDate": "2020-07-13T19:06:18.187Z",
          "content": "<p>It is off amigo, thanks!</p>",
          "rawMarkdown": "It is off amigo, thanks!"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 929508,
      "author_name": "TheStoneMX",
      "author_url": "",
      "post_date": "2020-07-14T17:58:46.863000",
      "content": "<p>found the solution, for anyone that is using Fastai.</p>\n\n<p>1.- you have to create the models directory.\n      Path('./models').mkdir(exist_ok=True, parents=True)\n      !cp '../input/panda-models/saved.pth' './models/saved.pth'\n     saved.pth is the fastai model</p>\n\n<p>2.- then once you load it you need to delete de file and directory\n    learn.load('saved') \n    !rm './models/saved.pth'\n    !rmdir './models'</p>\n\n<p>Then the submission file will always be there.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 926817,
      "author_name": "Kishore Badyakar",
      "author_url": "",
      "post_date": "2020-07-13T02:54:51",
      "content": "<p>You sure internet is off in your kernel (that's a prerequisite) ?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 927516,
          "author_name": "TheStoneMX",
          "author_url": "",
          "post_date": "2020-07-13T12:59:24.033000",
          "content": "<p><a href=\"/kishupro\">@kishupro</a> yes it is off.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 926771,
      "author_name": "TheStoneMX",
      "author_url": "",
      "post_date": "2020-07-13T01:27:17.230000",
      "content": "<p>This is the code that writes to submission.csv file which I can see on my working directory, but i cant see the submit button...... \n~~~\ndata_dir = '../input/prostate-cancer-grade-assessment'\ndf_train = pd.read_csv(os.path.join(data_dir, 'train.csv'))\ndf_test = pd.read_csv(os.path.join(data_dir, 'test.csv'))\ndf_sub = pd.read_csv(os.path.join(data_dir, 'sample_submission.csv'))</p>\n\n<p>model_dir = ''\nimage_folder = os.path.join(data_dir, 'test_images/')\nimage_folder = image_folder if is_test else os.path.join(data_dir, 'train_images/')\nimage_folder\n'../input/prostate-cancer-grade-assessment/test_images/'\n.\n.\n.\n.\n.\n.\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)</p>\n\n<h1>sub.to_csv('submission.csv', index=False)</h1>\n\n<p>print(df.head())\nprint()</p>\n\n<h1>print(df.isup_grade.value_counts())</h1>\n\n<pre><code>   image_id data_provider  isup_grade gleason_score\n</code></pre>\n\n<p>0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~</p>\n\n<p>Thanks for the help om advance</p>",
      "votes": 0,
      "replies": [
        {
          "id": 927826,
          "author_name": "TheStoneMX",
          "author_url": "",
          "post_date": "2020-07-13T15:43:48.910000",
          "content": "<p>I tried this but now I get csv file not found.... </p>\n\n<p>~~~\nTEST_PATH = '/kaggle/input/prostate-cancer-grade-assessment/test_images'</p>\n\n<p>if os.path.exists(TEST_PATH):\n    dls = dBlock.dataloaders(df_test, bs=8)</p>\n\n<pre><code>learn = Learner(dls, get_model())\nlearn.load('saved') \n\ntest_dl = dls.test_dl(df_test)\n_,_, preds = learn.get_preds(dl=test_dl, with_decoded=True)\n\ndf_test[\"isup_grade\"] = preds\nsub = df_test[[\"image_id\",\"isup_grade\"]]\nsub.to_csv('submission.csv', index=False) \n</code></pre>\n\n<p>else:\n    df_train =  df_train.loc[:5]\n    dls = dBlock.dataloaders(df_train, bs=8)</p>\n\n<pre><code>learn = Learner(dls, get_model())\nlearn.load('saved') \n\ntrain_dl = dls.test_dl(df_train)\n_,_, preds = learn.get_preds(dl=train_dl, with_decoded=True)\n\ndf_train[\"isup_grade\"] = preds\nsub = df_train[[\"image_id\",\"isup_grade\"]]\nsub.to_csv('submission.csv', index=Fals\n</code></pre>\n\n<p>~~~</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 928070,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-07-13T18:27:03.567000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 928130,
          "author_name": "TheStoneMX",
          "author_url": "",
          "post_date": "2020-07-13T19:06:18.187000",
          "content": "<p>It is off amigo, thanks!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "926686": "Hi there all,\n\nI finally got the code to run on Kaggle servers, but now I am getting this error.\n\nI have read the other threads but I cant find a solution.....\n\nand they are saying that I have written a submit.csv file in order to see the submit button\n\nBut I never get the submit button. \n\n~~\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)\nprint(df.head())\nprint()\nprint(df.isup_grade.value_counts())\n\n       image_id data_provider  isup_grade gleason_score\n0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~",
    "929508": "found the solution, for anyone that is using Fastai.\n\n1.- you have to create the models directory.\n      Path('./models').mkdir(exist_ok=True, parents=True)\n      !cp '../input/panda-models/saved.pth' './models/saved.pth'\n     saved.pth is the fastai model\n\n2.- then once you load it you need to delete de file and directory\n    learn.load('saved') \n    !rm './models/saved.pth'\n    !rmdir './models'\n\nThen the submission file will always be there.",
    "926817": "You sure internet is off in your kernel (that's a prerequisite) ?",
    "926771": "This is the code that writes to submission.csv file which I can see on my working directory, but i cant see the submit button...... \n~~~\ndata_dir = '../input/prostate-cancer-grade-assessment'\ndf_train = pd.read_csv(os.path.join(data_dir, 'train.csv'))\ndf_test = pd.read_csv(os.path.join(data_dir, 'test.csv'))\ndf_sub = pd.read_csv(os.path.join(data_dir, 'sample_submission.csv'))\n\nmodel_dir = ''\nimage_folder = os.path.join(data_dir, 'test_images/')\nimage_folder = image_folder if is_test else os.path.join(data_dir, 'train_images/')\nimage_folder\n'../input/prostate-cancer-grade-assessment/test_images/'\n.\n.\n.\n.\n.\n.\ndf[\"isup_grade\"] = preds\nsub = df[[\"image_id\",\"isup_grade\"]].to_csv('submission.csv', index=False)\n# sub.to_csv('submission.csv', index=False)\nprint(df.head())\nprint()\n# print(df.isup_grade.value_counts())\n\n       image_id data_provider  isup_grade gleason_score\n0  0005f7aaab2800f6170c399693a96917    karolinska           0           0+0\n1  000920ad0b612851f8e01bcc880d9b3d    karolinska           0           0+0\n2  0018ae58b01bdadc8e347995b69f99aa       radboud           4           4+4\n3  001c62abd11fa4b57bf7a6c603a11bb9    karolinska           4           4+4\n4  001d865e65ef5d2579c190a0e0350d8f    karolinska           0           0+0\n~~~\n\nThanks for the help om advance",
    "928070": ""
  }
}