yolor icon indicating copy to clipboard operation
yolor copied to clipboard

yolor_d6 cfg

Open Wooks-git opened this issue 3 years ago • 10 comments

Hi. where can i get yolord6.cfg file?

Wooks-git avatar Nov 19 '21 15:11 Wooks-git

Or tell us how to modify p6 or w6 cfg files to train a d6 model, Thanks

Deadpool5549 avatar Nov 21 '21 06:11 Deadpool5549

You can use the YAML file on paper branch.

Somu-cSs avatar Nov 22 '21 12:11 Somu-cSs

You can use the YAML file on paper branch.

Hi, I've found the YAML file. How do I convert the YAML to .cfg? Or is there a way to train with the YAML and not a .cfg? Thanks!

mattmorgan6 avatar Nov 23 '21 20:11 mattmorgan6

Hi Matt! the training command in paper branch looks like this python train.py --batch-size 8 --img 1280 1280 --data data/coco.yaml **--cfg models/yolor-p6.yaml** --weights '' --device 0 --name yolor-p6 --hyp hyp.scratch.1280.yaml --epochs 300 I think you can use the YAML files directly.

Deadpool5549 avatar Nov 24 '21 03:11 Deadpool5549

@Deadpool5549 Thanks for the help! That worked. I was getting an error originally because I was trying to use the models/yolor-d6.yaml on the main branch train.py when I should have been using the paper branch train.py. I ended up with better [email protected] with yolor-w6 than yolor-d6 though.

mattmorgan6 avatar Nov 30 '21 18:11 mattmorgan6

Hi I was wondering how to use D6 for inference with detect.py? by using the yolo_d6.yaml it does not work.

rusvagzur avatar Mar 18 '22 10:03 rusvagzur

Hi, this is the command I used for inference . Hope it helps ;) python detect.py --weights "path to weights" --conf <confidence value here> --source "path to video/image file/folder here"

Deadpool5549 avatar Mar 19 '22 10:03 Deadpool5549

@Deadpool5549 Thanks for the hint. however in your command, the config d6 is not being indicated. How are you doing it?

rusvagzur avatar Mar 22 '22 17:03 rusvagzur

You're welcome, I don't think we need it, maybe because we already have weight.pt file.

Deadpool5549 avatar Mar 23 '22 04:03 Deadpool5549

Hi. where can i get yolord6.cfg file?

I was having same doubt, I check in the repo for more info.

Inside WongKinYiu/yolor/tree/paper/models/yolo.py file Line 326 parser.add_argument('--cfg', type=str, default='yolov5s.yaml', help='model.yaml') You can find yolor-d6.yaml WongKinYiu/yolor/tree/paper/models/yolor-d6.yaml

File Location/Link
yolor-d6.yaml https://github.com/WongKinYiu/yolor/tree/paper/models/yolor-d6.yaml
yolor-d6.pt https://drive.google.com/file/d/1WX33ymg_XJLUJdoSf5oUYGHAtpSG2gj8/view or https://github.com/WongKinYiu/yolor/tree/paper

Hope this clears doubt for future visitors 🖖

Looking at the arguments the files require. WongKinYiu/yolor/tree/paper/detect.py cfg not required

parser = argparse.ArgumentParser()
    parser.add_argument('--weights', nargs='+', type=str, default='yolor-p6.pt', help='model.pt path(s)')
    parser.add_argument('--source', type=str, default='inference/images', help='source')  # file/folder, 0 for webcam
    parser.add_argument('--img-size', type=int, default=1280, help='inference size (pixels)')
    parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
    parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
    parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
    parser.add_argument('--view-img', action='store_true', help='display results')
    parser.add_argument('--save-txt', action='store_true', help='save results to *.txt')
    parser.add_argument('--save-conf', action='store_true', help='save confidences in --save-txt labels')
    parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3')
    parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS')
    parser.add_argument('--augment', action='store_true', help='augmented inference')
    parser.add_argument('--update', action='store_true', help='update all models')
    parser.add_argument('--project', default='runs/detect', help='save results to project/name')
    parser.add_argument('--name', default='exp', help='save results to project/name')
    parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
    opt = parser.parse_args()
    print(opt)

    with torch.no_grad():
        if opt.update:  # update all models (to fix SourceChangeWarning)
            for opt.weights in ['yolor-p6.pt', 'yolor-w6.pt', 'yolor-e6.pt', 'yolor-d6.pt']:
                detect()
                strip_optimizer(opt.weights)
        else:
            detect()

WongKinYiu/yolor/tree/paper/train.py cfg not required but you can specify

    parser = argparse.ArgumentParser()
    parser.add_argument('--weights', type=str, default='yolor-p6.pt', help='initial weights path')
    parser.add_argument('--cfg', type=str, default='', help='model.yaml path')
    parser.add_argument('--data', type=str, default='data/coco.yaml', help='data.yaml path')
    parser.add_argument('--hyp', type=str, default='data/hyp.scratch.1280.yaml', help='hyperparameters path')
    parser.add_argument('--epochs', type=int, default=300)
    parser.add_argument('--batch-size', type=int, default=8, help='total batch size for all GPUs')
    parser.add_argument('--img-size', nargs='+', type=int, default=[1280, 1280], help='[train, test] image sizes')
    parser.add_argument('--rect', action='store_true', help='rectangular training')
    parser.add_argument('--resume', nargs='?', const=True, default=False, help='resume most recent training')
    parser.add_argument('--nosave', action='store_true', help='only save final checkpoint')
    parser.add_argument('--notest', action='store_true', help='only test final epoch')
    parser.add_argument('--noautoanchor', action='store_true', help='disable autoanchor check')
    parser.add_argument('--evolve', action='store_true', help='evolve hyperparameters')
    parser.add_argument('--bucket', type=str, default='', help='gsutil bucket')
    parser.add_argument('--cache-images', action='store_true', help='cache images for faster training')
    parser.add_argument('--image-weights', action='store_true', help='use weighted image selection for training')
    parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
    parser.add_argument('--multi-scale', action='store_true', help='vary img-size +/- 50%%')
    parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset')
    parser.add_argument('--adam', action='store_true', help='use torch.optim.Adam() optimizer')
    parser.add_argument('--sync-bn', action='store_true', help='use SyncBatchNorm, only available in DDP mode')
    parser.add_argument('--local_rank', type=int, default=-1, help='DDP parameter, do not modify')
    parser.add_argument('--log-imgs', type=int, default=16, help='number of images for W&B logging, max 100')
    parser.add_argument('--workers', type=int, default=8, help='maximum number of dataloader workers')
    parser.add_argument('--project', default='runs/train', help='save to project/name')
    parser.add_argument('--name', default='exp', help='save to project/name')
    parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
    opt = parser.parse_args()

santhoshnumberone avatar May 04 '22 03:05 santhoshnumberone