{
  "id": 132473,
  "title": "num_workers speed tip",
  "url": "/competitions/bengaliai-cv19/discussion/132473",
  "author_name": "عثمان",
  "post_date": "2020-02-26T06:34:53.398000",
  "votes": 6,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Even though I consider myself a tf guy, using pytorch for this comp.</p>\n\n<p>In your <code>torch.utils.data.DataLoader</code> instances, be sure to set <code>num_workers</code> equal to a non-zero (default) number. For example, changing it to 3 from 0 is the difference between a +19min augmentation epoch vs a 5:50sec epoch on my machine. Make sure you return numpy arrays rather than torch cuda tensors, as prescribed in the documentation for <a href=\"https://pytorch.org/docs/stable/data.html#multi-process-data-loading\">multi-process training</a>. Numpy implicitly tries to use all your virtual cores anyway but can only go so fast, especially if your augmentation setup has a bunch of sequential steps in it.</p>\n\n<p>May your GPUs be ever fully utilized.</p>",
  "messages": [
    {
      "id": 756856,
      "postDate": "2020-02-26T06:34:53.400Z",
      "content": "<p>Even though I consider myself a tf guy, using pytorch for this comp.</p>\n\n<p>In your <code>torch.utils.data.DataLoader</code> instances, be sure to set <code>num_workers</code> equal to a non-zero (default) number. For example, changing it to 3 from 0 is the difference between a +19min augmentation epoch vs a 5:50sec epoch on my machine. Make sure you return numpy arrays rather than torch cuda tensors, as prescribed in the documentation for <a href=\"https://pytorch.org/docs/stable/data.html#multi-process-data-loading\">multi-process training</a>. Numpy implicitly tries to use all your virtual cores anyway but can only go so fast, especially if your augmentation setup has a bunch of sequential steps in it.</p>\n\n<p>May your GPUs be ever fully utilized.</p>",
      "rawMarkdown": "Even though I consider myself a tf guy, using pytorch for this comp.\n\nIn your `torch.utils.data.DataLoader` instances, be sure to set `num_workers` equal to a non-zero (default) number. For example, changing it to 3 from 0 is the difference between a +19min augmentation epoch vs a 5:50sec epoch on my machine. Make sure you return numpy arrays rather than torch cuda tensors, as prescribed in the documentation for [multi-process training](https://pytorch.org/docs/stable/data.html#multi-process-data-loading). Numpy implicitly tries to use all your virtual cores anyway but can only go so fast, especially if your augmentation setup has a bunch of sequential steps in it.\n\nMay your GPUs be ever fully utilized.",
      "votes": 6
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "756856": "Even though I consider myself a tf guy, using pytorch for this comp.\n\nIn your `torch.utils.data.DataLoader` instances, be sure to set `num_workers` equal to a non-zero (default) number. For example, changing it to 3 from 0 is the difference between a +19min augmentation epoch vs a 5:50sec epoch on my machine. Make sure you return numpy arrays rather than torch cuda tensors, as prescribed in the documentation for [multi-process training](https://pytorch.org/docs/stable/data.html#multi-process-data-loading). Numpy implicitly tries to use all your virtual cores anyway but can only go so fast, especially if your augmentation setup has a bunch of sequential steps in it.\n\nMay your GPUs be ever fully utilized."
  }
}