{
  "id": 253353,
  "title": " YOLOV5 - ValueError: zero-size array to reduction operation maximum which has no identity",
  "url": "/competitions/siim-covid19-detection/discussion/253353",
  "author_name": "",
  "post_date": "2021-07-16T08:35:41.742442900Z",
  "votes": 43,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Hi ,<br>\nI am facing issue with yolov5, I am new to yolo models. <br>\nWhile running my model yolov5, I was getting errors. anyone help me to solve this.<br>\nHere my training command.</p>\n<pre><code>!WANDB_MODE=\"dryrun\" python train.py --img 256 \\\n                 --batch 16 \\\n                 --epochs 10 \\\n                 --data data.yaml \\\n                 --weights yolov5x.pt --cache\n</code></pre>\n<p>Here My Error.<br>\n<code>``github: up to date with https://github.com/ultralytics/yolov5 ✅\n2021-07-16 08:23:26.085797: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.367811: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.370372: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\nwandb: W&amp;B syncing is set to</code>offline<code>in this directory.  Run</code>wandb online` or set WANDB_MODE=online to enable cloud syncing.<br>\nDownloading <a href=\"https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt\" target=\"_blank\">https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt</a> to yolov5x.pt…<br>\n100%|████████████████████████████████████████| 168M/168M [00:02&lt;00:00, 75.7MB/s]</p>\n<p>train: Scanning '../covid/labels/train' images and labels…4294 found, 2040 mis<br>\ntrain: Caching images (1.2GB): 100%|██████| 6334/6334 [00:03<br>\n    main(opt)<br>\n  File \"train.py\", line 558, in main<br>\n    train(opt.hyp, opt, device)<br>\n  File \"train.py\", line 228, in train<br>\n    mlc = np.concatenate(dataset.labels, 0)[:, 0].max()  # max label class<br>\n  File \"/opt/conda/lib/python3.7/site-packages/numpy/core/_methods.py\", line 39, in _amax<br>\n    return umr_maximum(a, axis, None, out, keepdims, initial, where)<br>\nValueError: zero-size array to reduction operation maximum which has no identity</p>\n<p>wandb: Waiting for W&amp;B process to finish, PID 852<br>\nwandb: Program failed with code 1. <br>\nwandb: Find user logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug.log<br>\nwandb: Find internal logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug-internal.log<br>\nwandb: You can sync this run to the cloud by running:<br>\nwandb: wandb sync /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80```</p>",
  "messages": [
    {
      "id": "1389939",
      "postDate": "07/16/2021 08:35:41",
      "content": "<p>Hi ,<br>\nI am facing issue with yolov5, I am new to yolo models. <br>\nWhile running my model yolov5, I was getting errors. anyone help me to solve this.<br>\nHere my training command.</p>\n<pre><code>!WANDB_MODE=\"dryrun\" python train.py --img 256 \\\n                 --batch 16 \\\n                 --epochs 10 \\\n                 --data data.yaml \\\n                 --weights yolov5x.pt --cache\n</code></pre>\n<p>Here My Error.<br>\n<code>``github: up to date with https://github.com/ultralytics/yolov5 ✅\n2021-07-16 08:23:26.085797: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.367811: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.370372: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\nwandb: W&amp;B syncing is set to</code>offline<code>in this directory.  Run</code>wandb online` or set WANDB_MODE=online to enable cloud syncing.<br>\nDownloading <a href=\"https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt\" target=\"_blank\">https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt</a> to yolov5x.pt…<br>\n100%|████████████████████████████████████████| 168M/168M [00:02&lt;00:00, 75.7MB/s]</p>\n<p>train: Scanning '../covid/labels/train' images and labels…4294 found, 2040 mis<br>\ntrain: Caching images (1.2GB): 100%|██████| 6334/6334 [00:03<br>\n    main(opt)<br>\n  File \"train.py\", line 558, in main<br>\n    train(opt.hyp, opt, device)<br>\n  File \"train.py\", line 228, in train<br>\n    mlc = np.concatenate(dataset.labels, 0)[:, 0].max()  # max label class<br>\n  File \"/opt/conda/lib/python3.7/site-packages/numpy/core/_methods.py\", line 39, in _amax<br>\n    return umr_maximum(a, axis, None, out, keepdims, initial, where)<br>\nValueError: zero-size array to reduction operation maximum which has no identity</p>\n<p>wandb: Waiting for W&amp;B process to finish, PID 852<br>\nwandb: Program failed with code 1. <br>\nwandb: Find user logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug.log<br>\nwandb: Find internal logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug-internal.log<br>\nwandb: You can sync this run to the cloud by running:<br>\nwandb: wandb sync /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80```</p>",
      "rawMarkdown": "Hi ,\nI am facing issue with yolov5, I am new to yolo models. \nWhile running my model yolov5, I was getting errors. anyone help me to solve this.\nHere my training command.\n```\n!WANDB_MODE=\"dryrun\" python train.py --img 256 \\\n                 --batch 16 \\\n                 --epochs 10 \\\n                 --data data.yaml \\\n                 --weights yolov5x.pt --cache\n```\n\nHere My Error.\n```github: up to date with https://github.com/ultralytics/yolov5 ✅\n2021-07-16 08:23:26.085797: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.367811: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.370372: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\nwandb: W&B syncing is set to `offline` in this directory.  Run `wandb online` or set WANDB_MODE=online to enable cloud syncing.\nDownloading https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt to yolov5x.pt...\n100%|████████████████████████████████████████| 168M/168M [00:02<00:00, 75.7MB/s]\n\ntrain: Scanning '../covid/labels/train' images and labels...4294 found, 2040 mis\ntrain: Caching images (1.2GB): 100%|██████| 6334/6334 [00:03<00:00, 1692.15it/s]\nTraceback (most recent call last):\n  File \"train.py\", line 660, in <module>\n    main(opt)\n  File \"train.py\", line 558, in main\n    train(opt.hyp, opt, device)\n  File \"train.py\", line 228, in train\n    mlc = np.concatenate(dataset.labels, 0)[:, 0].max()  # max label class\n  File \"/opt/conda/lib/python3.7/site-packages/numpy/core/_methods.py\", line 39, in _amax\n    return umr_maximum(a, axis, None, out, keepdims, initial, where)\nValueError: zero-size array to reduction operation maximum which has no identity\n\nwandb: Waiting for W&B process to finish, PID 852\nwandb: Program failed with code 1. \nwandb: Find user logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug.log\nwandb: Find internal logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug-internal.log\nwandb: You can sync this run to the cloud by running:\nwandb: wandb sync /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80```",
      "votes": null
    },
    {
      "id": "1394765",
      "postDate": "07/20/2021 15:30:10",
      "content": "<p>Which version is it? (yolov5)</p>",
      "rawMarkdown": "Which version is it? (yolov5)",
      "votes": null
    },
    {
      "id": "1395827",
      "postDate": "07/21/2021 14:57:55",
      "content": "<p>I am using version v5.0 Adrian</p>",
      "rawMarkdown": "I am using version v5.0 Adrian",
      "votes": null
    },
    {
      "id": "1396137",
      "postDate": "07/21/2021 20:06:24",
      "content": "<p>Check your dataset labels, they might not be in the correct format. </p>",
      "rawMarkdown": "Check your dataset labels, they might not be in the correct format.",
      "votes": null
    },
    {
      "id": "1396549",
      "postDate": "07/22/2021 07:36:17",
      "content": "<p>Hi  Ari, Thanks  for your replay.<br>\nmy  Dataset labels r u in right format only.<br>\n<a href=\"https://www.kaggle.com/sureshsuri/siim-covid-19\" target=\"_blank\">https://www.kaggle.com/sureshsuri/siim-covid-19</a></p>",
      "rawMarkdown": "Hi  Ari, Thanks  for your replay.\nmy  Dataset labels r u in right format only.\nhttps://www.kaggle.com/sureshsuri/siim-covid-19",
      "votes": null
    },
    {
      "id": "1399614",
      "postDate": "07/25/2021 14:08:49",
      "content": "<p>it seems like is your folder structure that didn't allow Yolo to pick up the image and label properly. </p>",
      "rawMarkdown": "it seems like is your folder structure that didn't allow Yolo to pick up the image and label properly.",
      "votes": null
    },
    {
      "id": "1401284",
      "postDate": "07/27/2021 07:16:39",
      "content": "<p>Hey HawKeat, <br>\nI given has a yolo excepted  folder Structure only , but  it is showing same  error.<br>\nThis is my  folder structure </p>\n<pre><code>/parent_folder\n   /dataset\n        /images\n            /train\n            /val\n        /labels\n            /train\n            /val\n   /yolov5\n</code></pre>",
      "rawMarkdown": "Hey HawKeat, \nI given has a yolo excepted  folder Structure only , but  it is showing same  error.\nThis is my  folder structure \n\n\n```\n/parent_folder\n    /dataset\n         /images\n             /train\n             /val\n         /labels\n             /train\n             /val\n    /yolov5\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1394765,
      "author_name": "cedrane310",
      "author_url": "",
      "post_date": "07/20/2021 15:30:10",
      "content": "<p>Which version is it? (yolov5)</p>",
      "votes": null,
      "replies": [
        {
          "id": 1395827,
          "author_name": "sureshsuri",
          "author_url": "",
          "post_date": "07/21/2021 14:57:55",
          "content": "<p>I am using version v5.0 Adrian</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1396137,
      "author_name": "vexxingbanana",
      "author_url": "",
      "post_date": "07/21/2021 20:06:24",
      "content": "<p>Check your dataset labels, they might not be in the correct format. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1396549,
          "author_name": "sureshsuri",
          "author_url": "",
          "post_date": "07/22/2021 07:36:17",
          "content": "<p>Hi  Ari, Thanks  for your replay.<br>\nmy  Dataset labels r u in right format only.<br>\n<a href=\"https://www.kaggle.com/sureshsuri/siim-covid-19\" target=\"_blank\">https://www.kaggle.com/sureshsuri/siim-covid-19</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1399614,
      "author_name": "hawkeat",
      "author_url": "",
      "post_date": "07/25/2021 14:08:49",
      "content": "<p>it seems like is your folder structure that didn't allow Yolo to pick up the image and label properly. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1401284,
          "author_name": "sureshsuri",
          "author_url": "",
          "post_date": "07/27/2021 07:16:39",
          "content": "<p>Hey HawKeat, <br>\nI given has a yolo excepted  folder Structure only , but  it is showing same  error.<br>\nThis is my  folder structure </p>\n<pre><code>/parent_folder\n   /dataset\n        /images\n            /train\n            /val\n        /labels\n            /train\n            /val\n   /yolov5\n</code></pre>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1389939": "Hi ,\nI am facing issue with yolov5, I am new to yolo models. \nWhile running my model yolov5, I was getting errors. anyone help me to solve this.\nHere my training command.\n```\n!WANDB_MODE=\"dryrun\" python train.py --img 256 \\\n                 --batch 16 \\\n                 --epochs 10 \\\n                 --data data.yaml \\\n                 --weights yolov5x.pt --cache\n```\n\nHere My Error.\n```github: up to date with https://github.com/ultralytics/yolov5 ✅\n2021-07-16 08:23:26.085797: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.367811: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\n2021-07-16 08:23:31.370372: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0\nwandb: W&B syncing is set to `offline` in this directory.  Run `wandb online` or set WANDB_MODE=online to enable cloud syncing.\nDownloading https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt to yolov5x.pt...\n100%|████████████████████████████████████████| 168M/168M [00:02<00:00, 75.7MB/s]\n\ntrain: Scanning '../covid/labels/train' images and labels...4294 found, 2040 mis\ntrain: Caching images (1.2GB): 100%|██████| 6334/6334 [00:03<00:00, 1692.15it/s]\nTraceback (most recent call last):\n  File \"train.py\", line 660, in <module>\n    main(opt)\n  File \"train.py\", line 558, in main\n    train(opt.hyp, opt, device)\n  File \"train.py\", line 228, in train\n    mlc = np.concatenate(dataset.labels, 0)[:, 0].max()  # max label class\n  File \"/opt/conda/lib/python3.7/site-packages/numpy/core/_methods.py\", line 39, in _amax\n    return umr_maximum(a, axis, None, out, keepdims, initial, where)\nValueError: zero-size array to reduction operation maximum which has no identity\n\nwandb: Waiting for W&B process to finish, PID 852\nwandb: Program failed with code 1. \nwandb: Find user logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug.log\nwandb: Find internal logs for this run at: /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80/logs/debug-internal.log\nwandb: You can sync this run to the cloud by running:\nwandb: wandb sync /kaggle/tmp/yolov5/wandb/offline-run-20210716_082330-1dufla80```",
    "1394765": "Which version is it? (yolov5)",
    "1395827": "I am using version v5.0 Adrian",
    "1396137": "Check your dataset labels, they might not be in the correct format.",
    "1396549": "Hi  Ari, Thanks  for your replay.\nmy  Dataset labels r u in right format only.\nhttps://www.kaggle.com/sureshsuri/siim-covid-19",
    "1399614": "it seems like is your folder structure that didn't allow Yolo to pick up the image and label properly.",
    "1401284": "Hey HawKeat, \nI given has a yolo excepted  folder Structure only , but  it is showing same  error.\nThis is my  folder structure \n\n\n```\n/parent_folder\n    /dataset\n         /images\n             /train\n             /val\n         /labels\n             /train\n             /val\n    /yolov5\n```"
  },
  "source": "meta"
}