Optimizer groups: 62 .bias, 70 conv.weight, 59 other
Traceback (most recent call last):
File "train.py", line 492, in
train(hyp, opt, device, tb_writer, wandb)
File "train.py", line 186, in train
image_weights=opt.image_weights)
TypeError: create_dataloader() got an unexpected keyword argument 'image_weights'
CPU times: user 27.2 ms, sys: 7.34 ms, total: 34.6 ms
Wall time: 7.95 s
[Note: New to Yolo]
Hello @MLcodie, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.
For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.[email protected].
Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:
$ pip install -r requirements.txt
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.
I have the same issue. Please give me a solution as soon as possible.
@MLcodie @Choikyungho9 this issue seems to lack the minimum requirements for a proper response, or is insufficiently detailed for us to help you. Please note that most technical problems are due to:
git clone version of this repo we can not debug it. Before going further run this code and verify your issue persists:$ git clone https://github.com/ultralytics/yolov5 yolov5_new # clone latest
$ cd yolov5_new
$ python detect.py # verify detection
# CODE TO REPRODUCE YOUR ISSUE HERE
Your custom data. If your issue is not reproducible in one of our 3 common datasets (COCO, COCO128, or VOC) we can not debug it. Visit our Custom Training Tutorial for guidelines on training your custom data. Examine train_batch0.jpg and test_batch0.jpg for a sanity check of your labels and images.
Your environment. If your issue is not reproducible in one of the verified environments below we can not debug it. If you are running YOLOv5 locally, verify your environment meets all of the requirements.txt dependencies specified below. If in doubt, download Python 3.8.0 from https://www.python.org/, create a new venv, and then install requirements.
If none of these apply to you, we suggest you close this issue and raise a new one using the Bug Report template, providing screenshots and minimum viable code to reproduce your issue. Thank you!
Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.6. To install run:
$ pip install -r requirements.txt
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu.
I have the same problem i've been working with the same colab notebook for the past few weeks in yolov5.
but somehow today i got this error :
Transferred 794/802 items from yolov5x.pt
Optimizer groups: 134 .bias, 142 conv.weight, 131 other
Traceback (most recent call last):
File "train.py", line 492, in
train(hyp, opt, device, tb_writer, wandb)
File "train.py", line 186, in train
image_weights=opt.image_weights)
TypeError: create_dataloader() got an unexpected keyword argument 'image_weights'
CPU times: user 73.4 ms, sys: 28.9 ms, total: 102 ms
Wall time: 17 s
while running this code for training :
!python train.py --img 416 --batch 40 --epochs 1000 --data '../data.yaml' --cfg /content/yolov5/models/yolov5x.yaml --weights yolov5x.pt --name yolov5x_results --cache
@asal97 this is due to your modified or out of date code. I'm running Colab trainings right now without issue.
git clone version of this repo we can not debug it. Before going further run this code and verify your issue persists:$ git clone https://github.com/ultralytics/yolov5 yolov5_new # clone latest
$ cd yolov5_new
$ python detect.py # verify detection
# CODE TO REPRODUCE YOUR ISSUE HERE
@MLcodie @Choikyungho9 @asal97 had the same issue, I resolved this by going to yolov5/train.py
line number 183
remove the argument image_weights=opt.image_weights
in dataloader, dataset = create_dataloader(train_path, imgsz, batch_size, gs, opt,
hyp=hyp, augment=True, cache=opt.cache_images, rect=opt.rect, rank=rank,
world_size=opt.world_size, workers=opt.workers,
image_weights=opt.image_weights)
@kchandawat your code is modified or out of date.
git clone version of this repo we can not debug it. Before going further run this code and verify your issue persists:$ git clone https://github.com/ultralytics/yolov5 yolov5_new # clone latest
$ cd yolov5_new
$ python detect.py # verify detection
# CODE TO REPRODUCE YOUR ISSUE HERE
@MLcodie @asal97 Here's an example YOLOv5 notebook that incorporates @kchandawat's suggested edit.
Most helpful comment
@MLcodie @asal97 Here's an example YOLOv5 notebook that incorporates @kchandawat's suggested edit.