{
  "id": 135857,
  "title": "Submission CSV not found",
  "url": "/competitions/deepfake-detection-challenge/discussion/135857",
  "author_name": "",
  "post_date": "2020-03-16T12:38:21.263661600Z",
  "votes": null,
  "comment_count": 14,
  "views": 0,
  "content": "<p>I'm unable to get my public score using the following code. I have tried multiple solutions to fix this problem, but nothing for me. Could anyone please look into this issue and help me.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2Fb881ea0789fe0bfe3f61aca8ec1bf911%2FUntitled.png?generation=1584428004574036&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "775230",
      "postDate": "03/16/2020 12:38:21",
      "content": "<p>I'm unable to get my public score using the following code. I have tried multiple solutions to fix this problem, but nothing for me. Could anyone please look into this issue and help me.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2Fb881ea0789fe0bfe3f61aca8ec1bf911%2FUntitled.png?generation=1584428004574036&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "I'm unable to get my public score using the following code. I have tried multiple solutions to fix this problem, but nothing for me. Could anyone please look into this issue and help me.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2Fb881ea0789fe0bfe3f61aca8ec1bf911%2FUntitled.png?generation=1584428004574036&amp;alt=media)",
      "votes": null
    },
    {
      "id": "775560",
      "postDate": "03/16/2020 20:06:12",
      "content": "<p>Your code is very hard to read without formatting...</p>",
      "rawMarkdown": "Your code is very hard to read without formatting...",
      "votes": null
    },
    {
      "id": "776160",
      "postDate": "03/17/2020 06:55:12",
      "content": "<p>I hope it is readable now, please help me. </p>",
      "rawMarkdown": "I hope it is readable now, please help me.",
      "votes": null
    },
    {
      "id": "776314",
      "postDate": "03/17/2020 09:51:03",
      "content": "<p>Just so you know, you don't need to upload your code as an image. You can start and end a code block with three backticks, like so: ```</p>\n\n<p><code>\nIt will look like this\n</code></p>",
      "rawMarkdown": "Just so you know, you don't need to upload your code as an image. You can start and end a code block with three backticks, like so: ```\n\n```\nIt will look like this\n```",
      "votes": null
    },
    {
      "id": "776315",
      "postDate": "03/17/2020 09:52:22",
      "content": "<p>How long does this code take to run after you press Commit?</p>",
      "rawMarkdown": "How long does this code take to run after you press Commit?",
      "votes": null
    },
    {
      "id": "776376",
      "postDate": "03/17/2020 10:51:48",
      "content": "<p>It takes 15 minutes.</p>",
      "rawMarkdown": "It takes 15 minutes.",
      "votes": null
    },
    {
      "id": "776377",
      "postDate": "03/17/2020 10:52:37",
      "content": "<p>Thanks.</p>",
      "rawMarkdown": "Thanks.",
      "votes": null
    },
    {
      "id": "776414",
      "postDate": "03/17/2020 11:25:56",
      "content": "<p>OK, 15 minutes is good.</p>\n\n<p>The other thing that you should do is add a <code>try ... except</code> around the video loading and model prediction. Some videos give errors.</p>",
      "rawMarkdown": "OK, 15 minutes is good.\n\nThe other thing that you should do is add a `try ... except` around the video loading and model prediction. Some videos give errors.",
      "votes": null
    },
    {
      "id": "776424",
      "postDate": "03/17/2020 11:36:12",
      "content": "<p>I tried that before and it didn't work. </p>",
      "rawMarkdown": "I tried that before and it didn't work.",
      "votes": null
    },
    {
      "id": "776444",
      "postDate": "03/17/2020 11:57:05",
      "content": "<p>You should also check that <code>success</code> is True and <code>vtframe</code> is not None after reading from the video.</p>",
      "rawMarkdown": "You should also check that `success` is True and `vtframe` is not None after reading from the video.",
      "votes": null
    },
    {
      "id": "776464",
      "postDate": "03/17/2020 12:13:08",
      "content": "<p>Success is True and vtframe is not None.  This code successfully generates the Submission.csv file. I'm unable to identify what's the problem with my code and submission.csv file. </p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2F511a6684244adc7b1ee6aecf40a4e701%2FUntitled.png?generation=1584447181682041&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Success is True and vtframe is not None.  This code successfully generates the Submission.csv file. I'm unable to identify what's the problem with my code and submission.csv file. \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2F511a6684244adc7b1ee6aecf40a4e701%2FUntitled.png?generation=1584447181682041&amp;alt=media)",
      "votes": null
    },
    {
      "id": "776528",
      "postDate": "03/17/2020 13:12:54",
      "content": "<p>My point is that when you submit to the competition, it uses a different set of videos. Some of those videos have errors. Your code may work fine on the small test set of 400 videos but that doesn't mean it also works fine on the videos used for the leaderboard.</p>",
      "rawMarkdown": "My point is that when you submit to the competition, it uses a different set of videos. Some of those videos have errors. Your code may work fine on the small test set of 400 videos but that doesn't mean it also works fine on the videos used for the leaderboard.",
      "votes": null
    },
    {
      "id": "778042",
      "postDate": "03/18/2020 05:15:07",
      "content": "<p><code>\nfor vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid) <br>\n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT)) <br>\n            imgs = []\n            for j in range(0, v_len): <br>\n                if j == 150:\n                    success = v_cap.grab()\n                    success, vtframe = v_cap.read()\n                    if success == False:\n                        fl = True\n                    else: <br>\n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY) <br>\n                        resized_image = cv2.resize(gframe, (128, 128)) <br>\n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            if fl == False:\n                v_cap.release()\n                imgs = np.array(imgs) <br>\n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except KeyboardInterrupt:\n            raise Exception(\"Stopped.\")\n</code>\nI have tried with this code but still submission CSV not found. Any guess?</p>",
      "rawMarkdown": "```\nfor vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid)           \n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT))          \n            imgs = []\n            for j in range(0, v_len):  \n                if j == 150:\n                    success = v_cap.grab()\n                    success, vtframe = v_cap.read()\n                    if success == False:\n                        fl = True\n                    else:    \n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY)      \n                        resized_image = cv2.resize(gframe, (128, 128))  \n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            if fl == False:\n                v_cap.release()\n                imgs = np.array(imgs)            \n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except KeyboardInterrupt:\n            raise Exception(\"Stopped.\")\n```\nI have tried with this code but still submission CSV not found. Any guess?",
      "votes": null
    },
    {
      "id": "778367",
      "postDate": "03/18/2020 11:27:35",
      "content": "<p>Try it like this:</p>\n\n<p><code>\n    for vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid) <br>\n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT)) <br>\n            imgs = []\n            for j in range(0, v_len): <br>\n                if j == 150:\n                    success, vtframe = v_cap.read()\n                    if success == False or vtframe is None:\n                        fl = True\n                        break <br>\n                    else: <br>\n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY) <br>\n                        resized_image = cv2.resize(gframe, (128, 128)) <br>\n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            v_cap.release()\n            if fl == False:\n                imgs = np.array(imgs) <br>\n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except:\n            test_results.append(0.5)\n</code></p>\n\n<p>P.S. I published <a href=\"https://www.kaggle.com/humananalog/inference-demo\">this notebook</a> a while ago that has a proven correct way of doing it.</p>",
      "rawMarkdown": "Try it like this:\n\n```\n    for vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid)           \n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT))          \n            imgs = []\n            for j in range(0, v_len):  \n                if j == 150:\n                    success, vtframe = v_cap.read()\n                    if success == False or vtframe is None:\n                        fl = True\n                        break    \n                    else:    \n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY)      \n                        resized_image = cv2.resize(gframe, (128, 128))  \n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            v_cap.release()\n            if fl == False:\n                imgs = np.array(imgs)            \n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except:\n            test_results.append(0.5)\n```\n\nP.S. I published [this notebook](https://www.kaggle.com/humananalog/inference-demo) a while ago that has a proven correct way of doing it.",
      "votes": null
    },
    {
      "id": "778475",
      "postDate": "03/18/2020 13:35:07",
      "content": "<p>Done. Thank you Human Analog. This is my first submission in any competition. It would not be possible without your help. Thanks again for your valuable time. </p>",
      "rawMarkdown": "Done. Thank you Human Analog. This is my first submission in any competition. It would not be possible without your help. Thanks again for your valuable time.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 775560,
      "author_name": "humananalog",
      "author_url": "",
      "post_date": "03/16/2020 20:06:12",
      "content": "<p>Your code is very hard to read without formatting...</p>",
      "votes": null,
      "replies": [
        {
          "id": 776160,
          "author_name": "arbishakram786",
          "author_url": "",
          "post_date": "03/17/2020 06:55:12",
          "content": "<p>I hope it is readable now, please help me. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 776314,
          "author_name": "humananalog",
          "author_url": "",
          "post_date": "03/17/2020 09:51:03",
          "content": "<p>Just so you know, you don't need to upload your code as an image. You can start and end a code block with three backticks, like so: ```</p>\n\n<p><code>\nIt will look like this\n</code></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 776377,
          "author_name": "arbishakram786",
          "author_url": "",
          "post_date": "03/17/2020 10:52:37",
          "content": "<p>Thanks.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 776315,
      "author_name": "humananalog",
      "author_url": "",
      "post_date": "03/17/2020 09:52:22",
      "content": "<p>How long does this code take to run after you press Commit?</p>",
      "votes": null,
      "replies": [
        {
          "id": 776376,
          "author_name": "arbishakram786",
          "author_url": "",
          "post_date": "03/17/2020 10:51:48",
          "content": "<p>It takes 15 minutes.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 776414,
          "author_name": "humananalog",
          "author_url": "",
          "post_date": "03/17/2020 11:25:56",
          "content": "<p>OK, 15 minutes is good.</p>\n\n<p>The other thing that you should do is add a <code>try ... except</code> around the video loading and model prediction. Some videos give errors.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 776424,
          "author_name": "arbishakram786",
          "author_url": "",
          "post_date": "03/17/2020 11:36:12",
          "content": "<p>I tried that before and it didn't work. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 776444,
          "author_name": "humananalog",
          "author_url": "",
          "post_date": "03/17/2020 11:57:05",
          "content": "<p>You should also check that <code>success</code> is True and <code>vtframe</code> is not None after reading from the video.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 776464,
          "author_name": "arbishakram786",
          "author_url": "",
          "post_date": "03/17/2020 12:13:08",
          "content": "<p>Success is True and vtframe is not None.  This code successfully generates the Submission.csv file. I'm unable to identify what's the problem with my code and submission.csv file. </p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2F511a6684244adc7b1ee6aecf40a4e701%2FUntitled.png?generation=1584447181682041&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 776528,
          "author_name": "humananalog",
          "author_url": "",
          "post_date": "03/17/2020 13:12:54",
          "content": "<p>My point is that when you submit to the competition, it uses a different set of videos. Some of those videos have errors. Your code may work fine on the small test set of 400 videos but that doesn't mean it also works fine on the videos used for the leaderboard.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 778042,
          "author_name": "arbishakram786",
          "author_url": "",
          "post_date": "03/18/2020 05:15:07",
          "content": "<p><code>\nfor vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid) <br>\n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT)) <br>\n            imgs = []\n            for j in range(0, v_len): <br>\n                if j == 150:\n                    success = v_cap.grab()\n                    success, vtframe = v_cap.read()\n                    if success == False:\n                        fl = True\n                    else: <br>\n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY) <br>\n                        resized_image = cv2.resize(gframe, (128, 128)) <br>\n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            if fl == False:\n                v_cap.release()\n                imgs = np.array(imgs) <br>\n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except KeyboardInterrupt:\n            raise Exception(\"Stopped.\")\n</code>\nI have tried with this code but still submission CSV not found. Any guess?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 778367,
          "author_name": "humananalog",
          "author_url": "",
          "post_date": "03/18/2020 11:27:35",
          "content": "<p>Try it like this:</p>\n\n<p><code>\n    for vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid) <br>\n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT)) <br>\n            imgs = []\n            for j in range(0, v_len): <br>\n                if j == 150:\n                    success, vtframe = v_cap.read()\n                    if success == False or vtframe is None:\n                        fl = True\n                        break <br>\n                    else: <br>\n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY) <br>\n                        resized_image = cv2.resize(gframe, (128, 128)) <br>\n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            v_cap.release()\n            if fl == False:\n                imgs = np.array(imgs) <br>\n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except:\n            test_results.append(0.5)\n</code></p>\n\n<p>P.S. I published <a href=\"https://www.kaggle.com/humananalog/inference-demo\">this notebook</a> a while ago that has a proven correct way of doing it.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 778475,
          "author_name": "arbishakram786",
          "author_url": "",
          "post_date": "03/18/2020 13:35:07",
          "content": "<p>Done. Thank you Human Analog. This is my first submission in any competition. It would not be possible without your help. Thanks again for your valuable time. </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "775230": "I'm unable to get my public score using the following code. I have tried multiple solutions to fix this problem, but nothing for me. Could anyone please look into this issue and help me.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2Fb881ea0789fe0bfe3f61aca8ec1bf911%2FUntitled.png?generation=1584428004574036&amp;alt=media)",
    "775560": "Your code is very hard to read without formatting...",
    "776160": "I hope it is readable now, please help me.",
    "776314": "Just so you know, you don't need to upload your code as an image. You can start and end a code block with three backticks, like so: ```\n\n```\nIt will look like this\n```",
    "776315": "How long does this code take to run after you press Commit?",
    "776376": "It takes 15 minutes.",
    "776377": "Thanks.",
    "776414": "OK, 15 minutes is good.\n\nThe other thing that you should do is add a `try ... except` around the video loading and model prediction. Some videos give errors.",
    "776424": "I tried that before and it didn't work.",
    "776444": "You should also check that `success` is True and `vtframe` is not None after reading from the video.",
    "776464": "Success is True and vtframe is not None.  This code successfully generates the Submission.csv file. I'm unable to identify what's the problem with my code and submission.csv file. \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4100254%2F511a6684244adc7b1ee6aecf40a4e701%2FUntitled.png?generation=1584447181682041&amp;alt=media)",
    "776528": "My point is that when you submit to the competition, it uses a different set of videos. Some of those videos have errors. Your code may work fine on the small test set of 400 videos but that doesn't mean it also works fine on the videos used for the leaderboard.",
    "778042": "```\nfor vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid)           \n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT))          \n            imgs = []\n            for j in range(0, v_len):  \n                if j == 150:\n                    success = v_cap.grab()\n                    success, vtframe = v_cap.read()\n                    if success == False:\n                        fl = True\n                    else:    \n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY)      \n                        resized_image = cv2.resize(gframe, (128, 128))  \n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            if fl == False:\n                v_cap.release()\n                imgs = np.array(imgs)            \n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except KeyboardInterrupt:\n            raise Exception(\"Stopped.\")\n```\nI have tried with this code but still submission CSV not found. Any guess?",
    "778367": "Try it like this:\n\n```\n    for vid in test_videos:\n        fl = False\n        try:\n            v_cap = cv2.VideoCapture(test_dir+vid)           \n            v_len = int(v_cap.get(cv2.CAP_PROP_FRAME_COUNT))          \n            imgs = []\n            for j in range(0, v_len):  \n                if j == 150:\n                    success, vtframe = v_cap.read()\n                    if success == False or vtframe is None:\n                        fl = True\n                        break    \n                    else:    \n                        gframe = cv2.cvtColor(vtframe, cv2.COLOR_BGR2GRAY)      \n                        resized_image = cv2.resize(gframe, (128, 128))  \n                        resize_image = np.reshape(resized_image, [128,128,1])\n                        imgs.append(resize_image)\n            v_cap.release()\n            if fl == False:\n                imgs = np.array(imgs)            \n                faces = model.predict(imgs)\n                faces = faces.squeeze()\n                test_results.append(faces) \n                print(vid, imgs.shape, faces)\n            else:\n                test_results.append(0.5)\n        except:\n            test_results.append(0.5)\n```\n\nP.S. I published [this notebook](https://www.kaggle.com/humananalog/inference-demo) a while ago that has a proven correct way of doing it.",
    "778475": "Done. Thank you Human Analog. This is my first submission in any competition. It would not be possible without your help. Thanks again for your valuable time."
  },
  "source": "meta"
}