{
  "id": 124852,
  "title": "tf.keras model not working",
  "url": "/competitions/bengaliai-cv19/discussion/124852",
  "author_name": "",
  "post_date": "2020-01-07T03:54:03.570790100Z",
  "votes": null,
  "comment_count": 12,
  "views": 0,
  "content": "<p>I can commit and the run goes fine but whenever I submit to the competition. It's always Notebook Threw Exception. Anyone else running into this issue? I'm using a custom tf.keras.model</p>",
  "messages": [
    {
      "id": "712302",
      "postDate": "01/07/2020 03:54:03",
      "content": "<p>I can commit and the run goes fine but whenever I submit to the competition. It's always Notebook Threw Exception. Anyone else running into this issue? I'm using a custom tf.keras.model</p>",
      "rawMarkdown": "I can commit and the run goes fine but whenever I submit to the competition. It's always Notebook Threw Exception. Anyone else running into this issue? I'm using a custom tf.keras.model",
      "votes": null
    },
    {
      "id": "712367",
      "postDate": "01/07/2020 06:28:11",
      "content": "<p>I don't think the error is due to <code>tf.keras.model</code>. Could you post your kernel(if possible) so that we can take a look and help you?</p>",
      "rawMarkdown": "I don't think the error is due to `tf.keras.model`. Could you post your kernel(if possible) so that we can take a look and help you?",
      "votes": null
    },
    {
      "id": "712541",
      "postDate": "01/07/2020 11:02:02",
      "content": "<p>See the following discusions:</p>\n\n<ul>\n<li><p><a href=\"https://www.kaggle.com/c/bengaliai-cv19/discussion/123632\">https://www.kaggle.com/c/bengaliai-cv19/discussion/123632</a></p></li>\n<li><p><a href=\"https://www.kaggle.com/c/bengaliai-cv19/discussion/123212\">https://www.kaggle.com/c/bengaliai-cv19/discussion/123212</a></p></li>\n<li><p><a href=\"https://www.kaggle.com/c/bengaliai-cv19/discussion/123659\">https://www.kaggle.com/c/bengaliai-cv19/discussion/123659</a></p></li>\n</ul>\n\n<p>As you will read in the posts, the best you can do is to make an inference on the train set images and check if agrees with the time/memory limits. </p>",
      "rawMarkdown": "See the following discusions:\n\n- https://www.kaggle.com/c/bengaliai-cv19/discussion/123632\n\n- https://www.kaggle.com/c/bengaliai-cv19/discussion/123212\n\n- https://www.kaggle.com/c/bengaliai-cv19/discussion/123659\n\nAs you will read in the posts, the best you can do is to make an inference on the train set images and check if agrees with the time/memory limits.",
      "votes": null
    },
    {
      "id": "712769",
      "postDate": "01/07/2020 15:09:46",
      "content": "<p><a href=\"/bibek777\">@bibek777</a> Here is my kernel. <a href=\"https://www.kaggle.com/shujun717/rebuilt-no-bn\">https://www.kaggle.com/shujun717/rebuilt-no-bn</a>. Much appreciated!</p>",
      "rawMarkdown": "bibek777 Here is my kernel. https://www.kaggle.com/shujun717/rebuilt-no-bn. Much appreciated!",
      "votes": null
    },
    {
      "id": "712819",
      "postDate": "01/07/2020 16:00:50",
      "content": "<p><a href=\"/bibek777\">@bibek777</a> Here is my kernel. <a href=\"https://www.kaggle.com/shujun717/rebuilt-no-bn\">https://www.kaggle.com/shujun717/rebuilt-no-bn</a>. Much appreciated!</p>",
      "rawMarkdown": "bibek777 Here is my kernel. https://www.kaggle.com/shujun717/rebuilt-no-bn. Much appreciated!",
      "votes": null
    },
    {
      "id": "712905",
      "postDate": "01/07/2020 17:55:13",
      "content": "<p>I looked at your kernel; looks fine to me. Don't know why itz giving the error. I will let you know if I find something else. </p>",
      "rawMarkdown": "I looked at your kernel; looks fine to me. Don't know why itz giving the error. I will let you know if I find something else.",
      "votes": null
    },
    {
      "id": "712954",
      "postDate": "01/07/2020 18:55:19",
      "content": "<p>Yeah it runs fine when commmited in the kernel but when submitted, something goes wrong.  Thx!</p>",
      "rawMarkdown": "Yeah it runs fine when commmited in the kernel but when submitted, something goes wrong.  Thx!",
      "votes": null
    },
    {
      "id": "712959",
      "postDate": "01/07/2020 19:02:48",
      "content": "<p>Are you sure about the submission file layout format? grapheme - vowel - consonant or consonant - grapheme - vowel?</p>",
      "rawMarkdown": "Are you sure about the submission file layout format? grapheme - vowel - consonant or consonant - grapheme - vowel?",
      "votes": null
    },
    {
      "id": "712992",
      "postDate": "01/07/2020 19:54:21",
      "content": "<p>actually i think the order in my code is wrong; however, one of my previous tensorflow models worked with the wrong order and i did get a reasonable score of ~ 0.93. Moreover, the notebook only runs for 4 minutes before it crashes when submitted so it did not even get to the submission part yet</p>",
      "rawMarkdown": "actually i think the order in my code is wrong; however, one of my previous tensorflow models worked with the wrong order and i did get a reasonable score of ~ 0.93. Moreover, the notebook only runs for 4 minutes before it crashes when submitted so it did not even get to the submission part yet",
      "votes": null
    },
    {
      "id": "712994",
      "postDate": "01/07/2020 19:55:06",
      "content": "<p>I tried doing inference with the training set. It worked in the kernels when committed</p>",
      "rawMarkdown": "I tried doing inference with the training set. It worked in the kernels when committed",
      "votes": null
    },
    {
      "id": "713216",
      "postDate": "01/08/2020 03:05:18",
      "content": "<p>Hi shujun,</p>\n\n<p>Are you loading model weights also? I dint see that in your code. After loading the model you also have to load it's weights may be that's the issue for you..</p>",
      "rawMarkdown": "Hi shujun,\n\nAre you loading model weights also? I dint see that in your code. After loading the model you also have to load it's weights may be that's the issue for you..",
      "votes": null
    },
    {
      "id": "714132",
      "postDate": "01/09/2020 05:13:38",
      "content": "<p>The dummy  test data that is replaced with actual test data is quite large . keeping that in mind are you not loading 10s of thousands of images in a large array ?</p>\n\n<p><code>images=np.asarray(images,dtype='float16')</code></p>\n\n<p>If you want to debug this , do one thing , run the same code on the train set (which is quite large) and not on the dummy test set (like how you are doing now) . You will find the exact memory error during commit itself .</p>",
      "rawMarkdown": "The dummy  test data that is replaced with actual test data is quite large . keeping that in mind are you not loading 10s of thousands of images in a large array ?\n\n`images=np.asarray(images,dtype='float16')`\n\nIf you want to debug this , do one thing , run the same code on the train set (which is quite large) and not on the dummy test set (like how you are doing now) . You will find the exact memory error during commit itself .",
      "votes": null
    },
    {
      "id": "714784",
      "postDate": "01/09/2020 18:31:31",
      "content": "<p>I didn't think that was the issue since that worked with one of my tf models with the training set. But I think you are right, since I tried getting batches of images at a time and it worked. Maybe the submission gets a little less memory than the notebook, because  images=np.asarray(images,dtype='float16')\nworked with the training set in the notebook?</p>",
      "rawMarkdown": "I didn't think that was the issue since that worked with one of my tf models with the training set. But I think you are right, since I tried getting batches of images at a time and it worked. Maybe the submission gets a little less memory than the notebook, because  images=np.asarray(images,dtype='float16')\nworked with the training set in the notebook?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 712367,
      "author_name": "bibek777",
      "author_url": "",
      "post_date": "01/07/2020 06:28:11",
      "content": "<p>I don't think the error is due to <code>tf.keras.model</code>. Could you post your kernel(if possible) so that we can take a look and help you?</p>",
      "votes": null,
      "replies": [
        {
          "id": 712819,
          "author_name": "shujun717",
          "author_url": "",
          "post_date": "01/07/2020 16:00:50",
          "content": "<p><a href=\"/bibek777\">@bibek777</a> Here is my kernel. <a href=\"https://www.kaggle.com/shujun717/rebuilt-no-bn\">https://www.kaggle.com/shujun717/rebuilt-no-bn</a>. Much appreciated!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 712905,
          "author_name": "bibek777",
          "author_url": "",
          "post_date": "01/07/2020 17:55:13",
          "content": "<p>I looked at your kernel; looks fine to me. Don't know why itz giving the error. I will let you know if I find something else. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 712954,
          "author_name": "shujun717",
          "author_url": "",
          "post_date": "01/07/2020 18:55:19",
          "content": "<p>Yeah it runs fine when commmited in the kernel but when submitted, something goes wrong.  Thx!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 712541,
      "author_name": "imeintanis",
      "author_url": "",
      "post_date": "01/07/2020 11:02:02",
      "content": "<p>See the following discusions:</p>\n\n<ul>\n<li><p><a href=\"https://www.kaggle.com/c/bengaliai-cv19/discussion/123632\">https://www.kaggle.com/c/bengaliai-cv19/discussion/123632</a></p></li>\n<li><p><a href=\"https://www.kaggle.com/c/bengaliai-cv19/discussion/123212\">https://www.kaggle.com/c/bengaliai-cv19/discussion/123212</a></p></li>\n<li><p><a href=\"https://www.kaggle.com/c/bengaliai-cv19/discussion/123659\">https://www.kaggle.com/c/bengaliai-cv19/discussion/123659</a></p></li>\n</ul>\n\n<p>As you will read in the posts, the best you can do is to make an inference on the train set images and check if agrees with the time/memory limits. </p>",
      "votes": null,
      "replies": [
        {
          "id": 712994,
          "author_name": "shujun717",
          "author_url": "",
          "post_date": "01/07/2020 19:55:06",
          "content": "<p>I tried doing inference with the training set. It worked in the kernels when committed</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 712769,
      "author_name": "shujun717",
      "author_url": "",
      "post_date": "01/07/2020 15:09:46",
      "content": "<p><a href=\"/bibek777\">@bibek777</a> Here is my kernel. <a href=\"https://www.kaggle.com/shujun717/rebuilt-no-bn\">https://www.kaggle.com/shujun717/rebuilt-no-bn</a>. Much appreciated!</p>",
      "votes": null,
      "replies": [
        {
          "id": 712959,
          "author_name": "ipythonx",
          "author_url": "",
          "post_date": "01/07/2020 19:02:48",
          "content": "<p>Are you sure about the submission file layout format? grapheme - vowel - consonant or consonant - grapheme - vowel?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 712992,
          "author_name": "shujun717",
          "author_url": "",
          "post_date": "01/07/2020 19:54:21",
          "content": "<p>actually i think the order in my code is wrong; however, one of my previous tensorflow models worked with the wrong order and i did get a reasonable score of ~ 0.93. Moreover, the notebook only runs for 4 minutes before it crashes when submitted so it did not even get to the submission part yet</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 713216,
      "author_name": "amit9484",
      "author_url": "",
      "post_date": "01/08/2020 03:05:18",
      "content": "<p>Hi shujun,</p>\n\n<p>Are you loading model weights also? I dint see that in your code. After loading the model you also have to load it's weights may be that's the issue for you..</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 714132,
      "author_name": "phoenix9032",
      "author_url": "",
      "post_date": "01/09/2020 05:13:38",
      "content": "<p>The dummy  test data that is replaced with actual test data is quite large . keeping that in mind are you not loading 10s of thousands of images in a large array ?</p>\n\n<p><code>images=np.asarray(images,dtype='float16')</code></p>\n\n<p>If you want to debug this , do one thing , run the same code on the train set (which is quite large) and not on the dummy test set (like how you are doing now) . You will find the exact memory error during commit itself .</p>",
      "votes": null,
      "replies": [
        {
          "id": 714784,
          "author_name": "shujun717",
          "author_url": "",
          "post_date": "01/09/2020 18:31:31",
          "content": "<p>I didn't think that was the issue since that worked with one of my tf models with the training set. But I think you are right, since I tried getting batches of images at a time and it worked. Maybe the submission gets a little less memory than the notebook, because  images=np.asarray(images,dtype='float16')\nworked with the training set in the notebook?</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "712302": "I can commit and the run goes fine but whenever I submit to the competition. It's always Notebook Threw Exception. Anyone else running into this issue? I'm using a custom tf.keras.model",
    "712367": "I don't think the error is due to `tf.keras.model`. Could you post your kernel(if possible) so that we can take a look and help you?",
    "712541": "See the following discusions:\n\n- https://www.kaggle.com/c/bengaliai-cv19/discussion/123632\n\n- https://www.kaggle.com/c/bengaliai-cv19/discussion/123212\n\n- https://www.kaggle.com/c/bengaliai-cv19/discussion/123659\n\nAs you will read in the posts, the best you can do is to make an inference on the train set images and check if agrees with the time/memory limits.",
    "712769": "bibek777 Here is my kernel. https://www.kaggle.com/shujun717/rebuilt-no-bn. Much appreciated!",
    "712819": "bibek777 Here is my kernel. https://www.kaggle.com/shujun717/rebuilt-no-bn. Much appreciated!",
    "712905": "I looked at your kernel; looks fine to me. Don't know why itz giving the error. I will let you know if I find something else.",
    "712954": "Yeah it runs fine when commmited in the kernel but when submitted, something goes wrong.  Thx!",
    "712959": "Are you sure about the submission file layout format? grapheme - vowel - consonant or consonant - grapheme - vowel?",
    "712992": "actually i think the order in my code is wrong; however, one of my previous tensorflow models worked with the wrong order and i did get a reasonable score of ~ 0.93. Moreover, the notebook only runs for 4 minutes before it crashes when submitted so it did not even get to the submission part yet",
    "712994": "I tried doing inference with the training set. It worked in the kernels when committed",
    "713216": "Hi shujun,\n\nAre you loading model weights also? I dint see that in your code. After loading the model you also have to load it's weights may be that's the issue for you..",
    "714132": "The dummy  test data that is replaced with actual test data is quite large . keeping that in mind are you not loading 10s of thousands of images in a large array ?\n\n`images=np.asarray(images,dtype='float16')`\n\nIf you want to debug this , do one thing , run the same code on the train set (which is quite large) and not on the dummy test set (like how you are doing now) . You will find the exact memory error during commit itself .",
    "714784": "I didn't think that was the issue since that worked with one of my tf models with the training set. But I think you are right, since I tried getting batches of images at a time and it worked. Maybe the submission gets a little less memory than the notebook, because  images=np.asarray(images,dtype='float16')\nworked with the training set in the notebook?"
  },
  "source": "meta"
}