{
  "id": 114444,
  "title": "RAM usage during inference",
  "url": "/competitions/rsna-intracranial-hemorrhage-detection/discussion/114444",
  "author_name": "Erwin John T. Carpio",
  "post_date": "2019-10-26T09:12:43.412000",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Greetings, just wanted to ask if anyone encountered a bottle neck during inference for the test images? I have a model scanning the folder. It can preduct up to a little over 1000 images but then my 12 gig ram maxes out and the script fails. Just wanted to ask if the solution is a script or there's no choice and I just need to upgrade to 16 gigs of more ram. Thanks. i'm running on ubuntu 18 with core I5 and 12 gigs of ram with tensorflow-cpu only. thanks.</p>",
  "messages": [
    {
      "id": 658620,
      "postDate": "2019-10-26T09:12:43.413Z",
      "content": "<p>Greetings, just wanted to ask if anyone encountered a bottle neck during inference for the test images? I have a model scanning the folder. It can preduct up to a little over 1000 images but then my 12 gig ram maxes out and the script fails. Just wanted to ask if the solution is a script or there's no choice and I just need to upgrade to 16 gigs of more ram. Thanks. i'm running on ubuntu 18 with core I5 and 12 gigs of ram with tensorflow-cpu only. thanks.</p>",
      "rawMarkdown": "Greetings, just wanted to ask if anyone encountered a bottle neck during inference for the test images? I have a model scanning the folder. It can preduct up to a little over 1000 images but then my 12 gig ram maxes out and the script fails. Just wanted to ask if the solution is a script or there's no choice and I just need to upgrade to 16 gigs of more ram. Thanks. i'm running on ubuntu 18 with core I5 and 12 gigs of ram with tensorflow-cpu only. thanks.",
      "votes": 1
    },
    {
      "id": 658696,
      "postDate": "2019-10-26T11:40:08.700Z",
      "content": "<p>Hi, this is related particularly to your solution - 1000 number of images in the RAM? That's too much. Rewrite your code to read images dynamically (as you do for train?). Reduce size of batch, number of workers etc.</p>",
      "rawMarkdown": "Hi, this is related particularly to your solution - 1000 number of images in the RAM? That's too much. Rewrite your code to read images dynamically (as you do for train?). Reduce size of batch, number of workers etc.",
      "votes": 2,
      "replies": [
        {
          "id": 659913,
          "postDate": "2019-10-28T12:35:57.707Z",
          "content": "<p>Hi i put my model.predict('image data for prediction\") inside a for loop that just scans the entire folder given the list of file names from the sample submission .csv file and set batch-size=1. Is the for loop the wrong way to do it? Thanks for your reply.</p>",
          "rawMarkdown": "Hi i put my model.predict('image data for prediction\") inside a for loop that just scans the entire folder given the list of file names from the sample submission .csv file and set batch-size=1. Is the for loop the wrong way to do it? Thanks for your reply."
        },
        {
          "id": 660869,
          "postDate": "2019-10-29T18:06:48.777Z",
          "content": "<p>Hi <a href=\"/radedje\">@radedje</a> the for loop is not the fastest solution but for sure a very simple and workable solution.</p>\n\n<p>Alternatively take a look at some of the kernels where for the test data a data generator is used in combination with model.predict_generator. I believe that for all major frameworks there are some kernels. So should be a matter of some investigation and copy/paste. Good luck.</p>",
          "rawMarkdown": "Hi @radedje the for loop is not the fastest solution but for sure a very simple and workable solution.\n\nAlternatively take a look at some of the kernels where for the test data a data generator is used in combination with model.predict_generator. I believe that for all major frameworks there are some kernels. So should be a matter of some investigation and copy/paste. Good luck.",
          "votes": 1
        },
        {
          "id": 663515,
          "postDate": "2019-11-02T07:52:37.463Z",
          "content": "<p>thanks. I'll look for some kernels.</p>",
          "rawMarkdown": "thanks. I'll look for some kernels."
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 658696,
      "author_name": "Oleg Yaroshevskiy",
      "author_url": "",
      "post_date": "2019-10-26T11:40:08.700000",
      "content": "<p>Hi, this is related particularly to your solution - 1000 number of images in the RAM? That's too much. Rewrite your code to read images dynamically (as you do for train?). Reduce size of batch, number of workers etc.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 659913,
          "author_name": "Erwin John T. Carpio",
          "author_url": "",
          "post_date": "2019-10-28T12:35:57.707000",
          "content": "<p>Hi i put my model.predict('image data for prediction\") inside a for loop that just scans the entire folder given the list of file names from the sample submission .csv file and set batch-size=1. Is the for loop the wrong way to do it? Thanks for your reply.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 660869,
          "author_name": "Robin Smits",
          "author_url": "",
          "post_date": "2019-10-29T18:06:48.777000",
          "content": "<p>Hi <a href=\"/radedje\">@radedje</a> the for loop is not the fastest solution but for sure a very simple and workable solution.</p>\n\n<p>Alternatively take a look at some of the kernels where for the test data a data generator is used in combination with model.predict_generator. I believe that for all major frameworks there are some kernels. So should be a matter of some investigation and copy/paste. Good luck.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 663515,
          "author_name": "Erwin John T. Carpio",
          "author_url": "",
          "post_date": "2019-11-02T07:52:37.463000",
          "content": "<p>thanks. I'll look for some kernels.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "658620": "Greetings, just wanted to ask if anyone encountered a bottle neck during inference for the test images? I have a model scanning the folder. It can preduct up to a little over 1000 images but then my 12 gig ram maxes out and the script fails. Just wanted to ask if the solution is a script or there's no choice and I just need to upgrade to 16 gigs of more ram. Thanks. i'm running on ubuntu 18 with core I5 and 12 gigs of ram with tensorflow-cpu only. thanks.",
    "658696": "Hi, this is related particularly to your solution - 1000 number of images in the RAM? That's too much. Rewrite your code to read images dynamically (as you do for train?). Reduce size of batch, number of workers etc."
  }
}