{
  "id": 163834,
  "title": "YOLOv5: How do you write data during training?",
  "url": "/competitions/global-wheat-detection/discussion/163834",
  "author_name": "",
  "post_date": "2020-07-03T16:34:07.966995600Z",
  "votes": 1,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I'm working on setting up YOLOv5, yes I'm aware there are notebooks in here that running but I'm setting up a basic version based on the Ultralytics tutorial:\n<a href=\"https://github.com/ultralytics/yolov5\">https://github.com/ultralytics/yolov5</a></p>\n\n<p>The issue is running the train.py. I'm running this:\n!python train.py --img 1024 --batch 2 --epochs 100 --data '../input/yolowheat/data.yaml' --cfg '../models/custom_yolov5s.yaml' --weights '' --name yolo5s_results --nosave --cache</p>\n\n<p>I get the following error because it cannot write to the input directory:\nTraceback (most recent call last):\n  File \"/kaggle/working/utils/datasets.py\", line 292, in <strong>init</strong>\n    raise Exception('%s does not exist' % path)\nException: ../train/images does not exist</p>\n\n<p>During handling of the above exception, another exception occurred:</p>\n\n<p>Traceback (most recent call last):\n  File \"train.py\", line 394, in \n    train(hyp)\n  File \"train.py\", line 166, in train\n    hyp=hyp, augment=True, cache=opt.cache_images, rect=opt.rect)\n  File \"/kaggle/working/utils/datasets.py\", line 52, in create_dataloader\n    pad=pad)\n  File \"/kaggle/working/utils/datasets.py\", line 295, in <strong>init</strong>\n    raise Exception('Error loading data from %s. See %s' % (path, help_url))\nException: Error loading data from ../train/images. See <a href=\"https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data\">https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data</a></p>\n\n<p>Any ideas how I write to the working directory?</p>",
  "messages": [
    {
      "id": "914120",
      "postDate": "07/03/2020 16:34:07",
      "content": "<p>I'm working on setting up YOLOv5, yes I'm aware there are notebooks in here that running but I'm setting up a basic version based on the Ultralytics tutorial:\n<a href=\"https://github.com/ultralytics/yolov5\">https://github.com/ultralytics/yolov5</a></p>\n\n<p>The issue is running the train.py. I'm running this:\n!python train.py --img 1024 --batch 2 --epochs 100 --data '../input/yolowheat/data.yaml' --cfg '../models/custom_yolov5s.yaml' --weights '' --name yolo5s_results --nosave --cache</p>\n\n<p>I get the following error because it cannot write to the input directory:\nTraceback (most recent call last):\n  File \"/kaggle/working/utils/datasets.py\", line 292, in <strong>init</strong>\n    raise Exception('%s does not exist' % path)\nException: ../train/images does not exist</p>\n\n<p>During handling of the above exception, another exception occurred:</p>\n\n<p>Traceback (most recent call last):\n  File \"train.py\", line 394, in \n    train(hyp)\n  File \"train.py\", line 166, in train\n    hyp=hyp, augment=True, cache=opt.cache_images, rect=opt.rect)\n  File \"/kaggle/working/utils/datasets.py\", line 52, in create_dataloader\n    pad=pad)\n  File \"/kaggle/working/utils/datasets.py\", line 295, in <strong>init</strong>\n    raise Exception('Error loading data from %s. See %s' % (path, help_url))\nException: Error loading data from ../train/images. See <a href=\"https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data\">https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data</a></p>\n\n<p>Any ideas how I write to the working directory?</p>",
      "rawMarkdown": "I'm working on setting up YOLOv5, yes I'm aware there are notebooks in here that running but I'm setting up a basic version based on the Ultralytics tutorial:\nhttps://github.com/ultralytics/yolov5\n\nThe issue is running the train.py. I'm running this:\n!python train.py --img 1024 --batch 2 --epochs 100 --data '../input/yolowheat/data.yaml' --cfg '../models/custom_yolov5s.yaml' --weights '' --name yolo5s_results --nosave --cache\n\nI get the following error because it cannot write to the input directory:\nTraceback (most recent call last):\n  File \"/kaggle/working/utils/datasets.py\", line 292, in __init__\n    raise Exception('%s does not exist' % path)\nException: ../train/images does not exist\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"train.py\", line 394, in",
      "votes": null
    },
    {
      "id": "914142",
      "postDate": "07/03/2020 16:38:09",
      "content": "<p>did you gave path for data to train in your command ? ( --data and --cfg arguments) </p>",
      "rawMarkdown": "did you gave path for data to train in your command ? ( --data and --cfg arguments)",
      "votes": null
    },
    {
      "id": "914196",
      "postDate": "07/03/2020 17:11:10",
      "content": "<p><a href=\"/nacirbouazizi\">@nacirbouazizi</a> </p>\n\n<p>This is what I setup:\n--data '../input/yolowheat/data.yaml' --cfg '../models/customyolov5s.yaml</p>\n\n<p>My image structure is in the same folder</p>\n\n<p>../input/yolowheat/train/images</p>",
      "rawMarkdown": "nacirbouazizi \n\nThis is what I setup:\n--data '../input/yolowheat/data.yaml' --cfg '../models/customyolov5s.yaml\n\nMy image structure is in the same folder\n\n../input/yolowheat/train/images",
      "votes": null
    },
    {
      "id": "914208",
      "postDate": "07/03/2020 17:17:13",
      "content": "<p>It's clearly a problem with your data.yaml file, show me the content of this file.</p>",
      "rawMarkdown": "It's clearly a problem with your data.yaml file, show me the content of this file.",
      "votes": null
    },
    {
      "id": "914405",
      "postDate": "07/03/2020 20:51:25",
      "content": "<p><a href=\"/nacirbouazizi\">@nacirbouazizi</a>  solved this with:\ntrain: ../input/yolowheat/WheatYolo/train/images\nval: ../input/yolowheat/WheatYolo/valid/images</p>\n\n<p>I just had the wrong structure :(</p>",
      "rawMarkdown": "nacirbouazizi  solved this with:\ntrain: ../input/yolowheat/WheatYolo/train/images\nval: ../input/yolowheat/WheatYolo/valid/images\n\nI just had the wrong structure :(",
      "votes": null
    },
    {
      "id": "914426",
      "postDate": "07/03/2020 21:13:22",
      "content": "<p>Can someone please help me out and tell me why I got a downvote? Should I have posted this elsewhere? </p>",
      "rawMarkdown": "Can someone please help me out and tell me why I got a downvote? Should I have posted this elsewhere?",
      "votes": null
    },
    {
      "id": "914536",
      "postDate": "07/04/2020 02:23:46",
      "content": "<p><a href=\"/crained\">@crained</a>  Yeah exactly ! good luck and feel free to dm me if you have any doubt 😄 \ncheck my notebook <a href=\"https://www.kaggle.com/nacirbouazizi/well-explained-training-pipeline-to-get-lb-0-760\">well-explained-training-pipeline-to-get-lb-0-760</a> to have better idea on how to train YOLOv5 step by step ! </p>",
      "rawMarkdown": "crained  Yeah exactly ! good luck and feel free to dm me if you have any doubt 😄 \ncheck my notebook [well-explained-training-pipeline-to-get-lb-0-760](https://www.kaggle.com/nacirbouazizi/well-explained-training-pipeline-to-get-lb-0-760) to have better idea on how to train YOLOv5 step by step !",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 914142,
      "author_name": "nacirbouazizi",
      "author_url": "",
      "post_date": "07/03/2020 16:38:09",
      "content": "<p>did you gave path for data to train in your command ? ( --data and --cfg arguments) </p>",
      "votes": null,
      "replies": [
        {
          "id": 914196,
          "author_name": "crained",
          "author_url": "",
          "post_date": "07/03/2020 17:11:10",
          "content": "<p><a href=\"/nacirbouazizi\">@nacirbouazizi</a> </p>\n\n<p>This is what I setup:\n--data '../input/yolowheat/data.yaml' --cfg '../models/customyolov5s.yaml</p>\n\n<p>My image structure is in the same folder</p>\n\n<p>../input/yolowheat/train/images</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 914208,
          "author_name": "nacirbouazizi",
          "author_url": "",
          "post_date": "07/03/2020 17:17:13",
          "content": "<p>It's clearly a problem with your data.yaml file, show me the content of this file.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 914405,
          "author_name": "crained",
          "author_url": "",
          "post_date": "07/03/2020 20:51:25",
          "content": "<p><a href=\"/nacirbouazizi\">@nacirbouazizi</a>  solved this with:\ntrain: ../input/yolowheat/WheatYolo/train/images\nval: ../input/yolowheat/WheatYolo/valid/images</p>\n\n<p>I just had the wrong structure :(</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 914536,
          "author_name": "nacirbouazizi",
          "author_url": "",
          "post_date": "07/04/2020 02:23:46",
          "content": "<p><a href=\"/crained\">@crained</a>  Yeah exactly ! good luck and feel free to dm me if you have any doubt 😄 \ncheck my notebook <a href=\"https://www.kaggle.com/nacirbouazizi/well-explained-training-pipeline-to-get-lb-0-760\">well-explained-training-pipeline-to-get-lb-0-760</a> to have better idea on how to train YOLOv5 step by step ! </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 914426,
      "author_name": "crained",
      "author_url": "",
      "post_date": "07/03/2020 21:13:22",
      "content": "<p>Can someone please help me out and tell me why I got a downvote? Should I have posted this elsewhere? </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "914120": "I'm working on setting up YOLOv5, yes I'm aware there are notebooks in here that running but I'm setting up a basic version based on the Ultralytics tutorial:\nhttps://github.com/ultralytics/yolov5\n\nThe issue is running the train.py. I'm running this:\n!python train.py --img 1024 --batch 2 --epochs 100 --data '../input/yolowheat/data.yaml' --cfg '../models/custom_yolov5s.yaml' --weights '' --name yolo5s_results --nosave --cache\n\nI get the following error because it cannot write to the input directory:\nTraceback (most recent call last):\n  File \"/kaggle/working/utils/datasets.py\", line 292, in __init__\n    raise Exception('%s does not exist' % path)\nException: ../train/images does not exist\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"train.py\", line 394, in",
    "914142": "did you gave path for data to train in your command ? ( --data and --cfg arguments)",
    "914196": "nacirbouazizi \n\nThis is what I setup:\n--data '../input/yolowheat/data.yaml' --cfg '../models/customyolov5s.yaml\n\nMy image structure is in the same folder\n\n../input/yolowheat/train/images",
    "914208": "It's clearly a problem with your data.yaml file, show me the content of this file.",
    "914405": "nacirbouazizi  solved this with:\ntrain: ../input/yolowheat/WheatYolo/train/images\nval: ../input/yolowheat/WheatYolo/valid/images\n\nI just had the wrong structure :(",
    "914426": "Can someone please help me out and tell me why I got a downvote? Should I have posted this elsewhere?",
    "914536": "crained  Yeah exactly ! good luck and feel free to dm me if you have any doubt 😄 \ncheck my notebook [well-explained-training-pipeline-to-get-lb-0-760](https://www.kaggle.com/nacirbouazizi/well-explained-training-pipeline-to-get-lb-0-760) to have better idea on how to train YOLOv5 step by step !"
  },
  "source": "meta"
}