{
  "id": 383755,
  "title": "Reading videos without going OOM during submission",
  "url": "/competitions/nfl-player-contact-detection/discussion/383755",
  "author_name": "Jebastin Nadar",
  "post_date": "2023-02-05T03:26:34.667000",
  "votes": 1,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I've been trying to read videos using <code>decord</code>, but my submission fails due to OOM. I've tried deleting the videos and using <code>gc.collect()</code>, but no success yet. I was wondering if other kagglers are willing to share how they are reading videos for their submissions, or what packages are you using?</p>\n<p>Psuedo-code for what I'm trying to do</p>\n<pre><code> decord  VideoReader, cpu\n\n game_play  tqdm(game_plays):\n    video_sideline = VideoReader(, ctx=cpu()) \n    video_endzone = VideoReader(, ctx=cpu())\n\n    preds = get_preds(video_sideline, video_endzone)\n\n     video_sideline, video_endzone\n    gc.collect()\n</code></pre>",
  "messages": [
    {
      "id": 2129945,
      "postDate": "2023-02-05T03:26:34.667Z",
      "content": "<p>I've been trying to read videos using <code>decord</code>, but my submission fails due to OOM. I've tried deleting the videos and using <code>gc.collect()</code>, but no success yet. I was wondering if other kagglers are willing to share how they are reading videos for their submissions, or what packages are you using?</p>\n<p>Psuedo-code for what I'm trying to do</p>\n<pre><code> decord  VideoReader, cpu\n\n game_play  tqdm(game_plays):\n    video_sideline = VideoReader(, ctx=cpu()) \n    video_endzone = VideoReader(, ctx=cpu())\n\n    preds = get_preds(video_sideline, video_endzone)\n\n     video_sideline, video_endzone\n    gc.collect()\n</code></pre>",
      "rawMarkdown": "I've been trying to read videos using `decord`, but my submission fails due to OOM. I've tried deleting the videos and using `gc.collect()`, but no success yet. I was wondering if other kagglers are willing to share how they are reading videos for their submissions, or what packages are you using?\n\nPsuedo-code for what I'm trying to do\n```python\nfrom decord import VideoReader, cpu\n\nfor game_play in tqdm(game_plays):\n    video_sideline = VideoReader(f\"{path}/{game_play}_Sideline.mp4\", ctx=cpu()) \n    video_endzone = VideoReader(f\"{path}/{game_play}_Endzone.mp4\", ctx=cpu())\n\n    preds = get_preds(video_sideline, video_endzone)\n\n    del video_sideline, video_endzone\n    gc.collect()\n```",
      "votes": 1
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2129945": "I've been trying to read videos using `decord`, but my submission fails due to OOM. I've tried deleting the videos and using `gc.collect()`, but no success yet. I was wondering if other kagglers are willing to share how they are reading videos for their submissions, or what packages are you using?\n\nPsuedo-code for what I'm trying to do\n```python\nfrom decord import VideoReader, cpu\n\nfor game_play in tqdm(game_plays):\n    video_sideline = VideoReader(f\"{path}/{game_play}_Sideline.mp4\", ctx=cpu()) \n    video_endzone = VideoReader(f\"{path}/{game_play}_Endzone.mp4\", ctx=cpu())\n\n    preds = get_preds(video_sideline, video_endzone)\n\n    del video_sideline, video_endzone\n    gc.collect()\n```"
  }
}