{
  "id": 157644,
  "title": "Another submission no found error!",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/157644",
  "author_name": "George",
  "post_date": "2020-06-11T13:43:21.681000",
  "votes": 0,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Ahh.. If anyone can see any errors please let me know.</p>\n\n<p>I am using:</p>\n\n<p>```\n...\nDATA_PATH = '/kaggle/input/prostate-cancer-grade-assessment'\nMODELS_PATH = '/kaggle/input/prostate-keras'\nMDL_VERSION = 'v0'\nIMG_SIZE = 64\nSEQ_LEN = 25</p>\n\n<p>(I am defining  class DataGenPanda(Sequence):... )\n...\nmodel_file = '{}/model_{}.h5'.format(MODELS_PATH, MDL_VERSION)</p>\n\n<p>class FixedDropout(tf.keras.layers.Dropout):\n    def _get_noise_shape(self, inputs):\n        if self.noise_shape is None:\n            return self.noise_shape\n        symbolic_shape = K.shape(inputs)\n        noise_shape = [symbolic_shape[axis] if shape is None else shape for axis, shape in enumerate(self.noise_shape)]\n        return tuple(noise_shape)</p>\n\n<p>model = load_model(model_file, compile=False, custom_objects={'FixedDropout':FixedDropout})</p>\n\n<h1>test = pd.read_csv('{}/test.csv'.format(DATA_PATH))</h1>\n\n<p>test = pd.read_csv('/kaggle/input/prostate-cancer-grade-assessment/sample_submission.csv')\npreds = [[0] * 6] * len(test)\nif os.path.exists('/kaggle/input/prostate-cancer-grade-assessment/test_images'):\n    subm_datagen = DataGenPanda(\n        imgs_path='{}/test_images'.format(DATA_PATH), \n        df=test,\n        batch_size=1,\n        mode='predict', \n        shuffle=False, \n        aug=None, \n        seq_len=SEQ_LEN, \n        img_size=IMG_SIZE, \n        n_classes=6\n    )\n    preds = model.predict_generator(subm_datagen)\n    print('preds done, total:', len(preds))\nelse:\n    print('preds are zeros')\ntest['isup_grade'] = np.argmax(preds, axis=1)</p>\n\n<h1>test.drop('data_provider', axis=1, inplace=True)</h1>\n\n<p>test.to_csv('submission.csv', index=False)\nprint('submission saved')\n```</p>\n\n<p>Any ideas?\nThanks!</p>",
  "messages": [
    {
      "id": 893097,
      "postDate": "2020-06-19T11:38:21.663Z",
      "content": "<p>I tried to submit the prediction but I got an error in submission scoring but in a similar way  I submitted two predictions previously  it works well but it has not been effective since yesterday. </p>",
      "rawMarkdown": "I tried to submit the prediction but I got an error in submission scoring but in a similar way  I submitted two predictions previously  it works well but it has not been effective since yesterday. \n"
    },
    {
      "id": 889921,
      "postDate": "2020-06-17T08:02:43.433Z",
      "content": "<p>I have tried with train images and I receive no errror!\nWeird</p>",
      "rawMarkdown": "I have tried with train images and I receive no errror!\nWeird",
      "replies": [
        {
          "id": 890187,
          "postDate": "2020-06-17T11:21:28.797Z",
          "content": "<p>Are you perhaps trying to access any other columns than the image id column within the data generator, such as the isup grade? I had a similar experience with that.</p>\n\n<p>Else: make sure internet access is disabled.</p>",
          "rawMarkdown": "Are you perhaps trying to access any other columns than the image id column within the data generator, such as the isup grade? I had a similar experience with that.\n\nElse: make sure internet access is disabled."
        },
        {
          "id": 890383,
          "postDate": "2020-06-17T13:35:29.053Z",
          "content": "<p>Hi, as you can see I am just accessing test dataframe.\nInternet is off.</p>",
          "rawMarkdown": "Hi, as you can see I am just accessing test dataframe.\nInternet is off."
        },
        {
          "id": 890547,
          "postDate": "2020-06-17T15:03:20.350Z",
          "content": "<p>Yes, but I mean, are you perhaps accessing the isup grade, gleason score, or data provider columns within DataGenPanda? If so, those are not available within the test dataframe, and would give an error.</p>\n\n<p>My guess is that there is just a small line of code that tries to access something that is present within the train datasets, but not in the test datasets (as I just mentioned above).</p>",
          "rawMarkdown": "Yes, but I mean, are you perhaps accessing the isup grade, gleason score, or data provider columns within DataGenPanda? If so, those are not available within the test dataframe, and would give an error.\n\nMy guess is that there is just a small line of code that tries to access something that is present within the train datasets, but not in the test datasets (as I just mentioned above)."
        },
        {
          "id": 890929,
          "postDate": "2020-06-17T19:11:26.177Z",
          "content": "<p>As far as I can tell , it's ok.</p>\n\n<p>I am using <a href=\"https://www.kaggle.com/vgarshin/panda-keras-baseline\">this DataGen</a> and it works fine for the author.</p>",
          "rawMarkdown": "As far as I can tell , it's ok.\n\nI am using [this DataGen](https://www.kaggle.com/vgarshin/panda-keras-baseline) and it works fine for the author."
        }
      ]
    },
    {
      "id": 881944,
      "postDate": "2020-06-11T13:43:21.683Z",
      "content": "<p>Ahh.. If anyone can see any errors please let me know.</p>\n\n<p>I am using:</p>\n\n<p>```\n...\nDATA_PATH = '/kaggle/input/prostate-cancer-grade-assessment'\nMODELS_PATH = '/kaggle/input/prostate-keras'\nMDL_VERSION = 'v0'\nIMG_SIZE = 64\nSEQ_LEN = 25</p>\n\n<p>(I am defining  class DataGenPanda(Sequence):... )\n...\nmodel_file = '{}/model_{}.h5'.format(MODELS_PATH, MDL_VERSION)</p>\n\n<p>class FixedDropout(tf.keras.layers.Dropout):\n    def _get_noise_shape(self, inputs):\n        if self.noise_shape is None:\n            return self.noise_shape\n        symbolic_shape = K.shape(inputs)\n        noise_shape = [symbolic_shape[axis] if shape is None else shape for axis, shape in enumerate(self.noise_shape)]\n        return tuple(noise_shape)</p>\n\n<p>model = load_model(model_file, compile=False, custom_objects={'FixedDropout':FixedDropout})</p>\n\n<h1>test = pd.read_csv('{}/test.csv'.format(DATA_PATH))</h1>\n\n<p>test = pd.read_csv('/kaggle/input/prostate-cancer-grade-assessment/sample_submission.csv')\npreds = [[0] * 6] * len(test)\nif os.path.exists('/kaggle/input/prostate-cancer-grade-assessment/test_images'):\n    subm_datagen = DataGenPanda(\n        imgs_path='{}/test_images'.format(DATA_PATH), \n        df=test,\n        batch_size=1,\n        mode='predict', \n        shuffle=False, \n        aug=None, \n        seq_len=SEQ_LEN, \n        img_size=IMG_SIZE, \n        n_classes=6\n    )\n    preds = model.predict_generator(subm_datagen)\n    print('preds done, total:', len(preds))\nelse:\n    print('preds are zeros')\ntest['isup_grade'] = np.argmax(preds, axis=1)</p>\n\n<h1>test.drop('data_provider', axis=1, inplace=True)</h1>\n\n<p>test.to_csv('submission.csv', index=False)\nprint('submission saved')\n```</p>\n\n<p>Any ideas?\nThanks!</p>",
      "rawMarkdown": "Ahh.. If anyone can see any errors please let me know.\n\nI am using:\n\n```\n...\nDATA_PATH = '/kaggle/input/prostate-cancer-grade-assessment'\nMODELS_PATH = '/kaggle/input/prostate-keras'\nMDL_VERSION = 'v0'\nIMG_SIZE = 64\nSEQ_LEN = 25\n\n(I am defining  class DataGenPanda(Sequence):... )\n...\nmodel_file = '{}/model_{}.h5'.format(MODELS_PATH, MDL_VERSION)\n\nclass FixedDropout(tf.keras.layers.Dropout):\n    def _get_noise_shape(self, inputs):\n        if self.noise_shape is None:\n            return self.noise_shape\n        symbolic_shape = K.shape(inputs)\n        noise_shape = [symbolic_shape[axis] if shape is None else shape for axis, shape in enumerate(self.noise_shape)]\n        return tuple(noise_shape)\n\nmodel = load_model(model_file, compile=False, custom_objects={'FixedDropout':FixedDropout})\n\n#test = pd.read_csv('{}/test.csv'.format(DATA_PATH))\ntest = pd.read_csv('/kaggle/input/prostate-cancer-grade-assessment/sample_submission.csv')\npreds = [[0] * 6] * len(test)\nif os.path.exists('/kaggle/input/prostate-cancer-grade-assessment/test_images'):\n    subm_datagen = DataGenPanda(\n        imgs_path='{}/test_images'.format(DATA_PATH), \n        df=test,\n        batch_size=1,\n        mode='predict', \n        shuffle=False, \n        aug=None, \n        seq_len=SEQ_LEN, \n        img_size=IMG_SIZE, \n        n_classes=6\n    )\n    preds = model.predict_generator(subm_datagen)\n    print('preds done, total:', len(preds))\nelse:\n    print('preds are zeros')\ntest['isup_grade'] = np.argmax(preds, axis=1)\n#test.drop('data_provider', axis=1, inplace=True)\ntest.to_csv('submission.csv', index=False)\nprint('submission saved')\n```\n\nAny ideas?\nThanks!\n"
    }
  ],
  "comments": [
    {
      "id": 893097,
      "author_name": "sana",
      "author_url": "",
      "post_date": "2020-06-19T11:38:21.663000",
      "content": "<p>I tried to submit the prediction but I got an error in submission scoring but in a similar way  I submitted two predictions previously  it works well but it has not been effective since yesterday. </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 889921,
      "author_name": "George",
      "author_url": "",
      "post_date": "2020-06-17T08:02:43.433000",
      "content": "<p>I have tried with train images and I receive no errror!\nWeird</p>",
      "votes": 0,
      "replies": [
        {
          "id": 890187,
          "author_name": "Stephan",
          "author_url": "",
          "post_date": "2020-06-17T11:21:28.797000",
          "content": "<p>Are you perhaps trying to access any other columns than the image id column within the data generator, such as the isup grade? I had a similar experience with that.</p>\n\n<p>Else: make sure internet access is disabled.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 890383,
          "author_name": "George",
          "author_url": "",
          "post_date": "2020-06-17T13:35:29.053000",
          "content": "<p>Hi, as you can see I am just accessing test dataframe.\nInternet is off.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 890547,
          "author_name": "Stephan",
          "author_url": "",
          "post_date": "2020-06-17T15:03:20.350000",
          "content": "<p>Yes, but I mean, are you perhaps accessing the isup grade, gleason score, or data provider columns within DataGenPanda? If so, those are not available within the test dataframe, and would give an error.</p>\n\n<p>My guess is that there is just a small line of code that tries to access something that is present within the train datasets, but not in the test datasets (as I just mentioned above).</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 890929,
          "author_name": "George",
          "author_url": "",
          "post_date": "2020-06-17T19:11:26.177000",
          "content": "<p>As far as I can tell , it's ok.</p>\n\n<p>I am using <a href=\"https://www.kaggle.com/vgarshin/panda-keras-baseline\">this DataGen</a> and it works fine for the author.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "893097": "I tried to submit the prediction but I got an error in submission scoring but in a similar way  I submitted two predictions previously  it works well but it has not been effective since yesterday. \n",
    "889921": "I have tried with train images and I receive no errror!\nWeird",
    "881944": "Ahh.. If anyone can see any errors please let me know.\n\nI am using:\n\n```\n...\nDATA_PATH = '/kaggle/input/prostate-cancer-grade-assessment'\nMODELS_PATH = '/kaggle/input/prostate-keras'\nMDL_VERSION = 'v0'\nIMG_SIZE = 64\nSEQ_LEN = 25\n\n(I am defining  class DataGenPanda(Sequence):... )\n...\nmodel_file = '{}/model_{}.h5'.format(MODELS_PATH, MDL_VERSION)\n\nclass FixedDropout(tf.keras.layers.Dropout):\n    def _get_noise_shape(self, inputs):\n        if self.noise_shape is None:\n            return self.noise_shape\n        symbolic_shape = K.shape(inputs)\n        noise_shape = [symbolic_shape[axis] if shape is None else shape for axis, shape in enumerate(self.noise_shape)]\n        return tuple(noise_shape)\n\nmodel = load_model(model_file, compile=False, custom_objects={'FixedDropout':FixedDropout})\n\n#test = pd.read_csv('{}/test.csv'.format(DATA_PATH))\ntest = pd.read_csv('/kaggle/input/prostate-cancer-grade-assessment/sample_submission.csv')\npreds = [[0] * 6] * len(test)\nif os.path.exists('/kaggle/input/prostate-cancer-grade-assessment/test_images'):\n    subm_datagen = DataGenPanda(\n        imgs_path='{}/test_images'.format(DATA_PATH), \n        df=test,\n        batch_size=1,\n        mode='predict', \n        shuffle=False, \n        aug=None, \n        seq_len=SEQ_LEN, \n        img_size=IMG_SIZE, \n        n_classes=6\n    )\n    preds = model.predict_generator(subm_datagen)\n    print('preds done, total:', len(preds))\nelse:\n    print('preds are zeros')\ntest['isup_grade'] = np.argmax(preds, axis=1)\n#test.drop('data_provider', axis=1, inplace=True)\ntest.to_csv('submission.csv', index=False)\nprint('submission saved')\n```\n\nAny ideas?\nThanks!\n"
  }
}