yolov5 icon indicating copy to clipboard operation
yolov5 copied to clipboard

config for resnet and mobilenet

Open bzha5848 opened this issue 2 years ago • 6 comments

Search before asking

  • [X] I have searched the YOLOv5 issues and found no similar feature requests.

Description

Hi there,

Just wondering is that possible to create config model for resnet and mobilenet like the way we have for yolov5? And we can use the new pre-trained model to fine-tuning?

Thanks so much!!

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

bzha5848 avatar Sep 09 '22 17:09 bzha5848

@bzha5848 you can start training from resnet and efficientnet pretrained classificaiton models easily. See README Classification section for details. https://github.com/ultralytics/yolov5#classification--new

glenn-jocher avatar Sep 09 '22 21:09 glenn-jocher

Yeah, but I wanna keep the backbone of resnet and efficient and fine-tuning them with the head of yolov5, will that be possible?

bzha5848 avatar Sep 09 '22 23:09 bzha5848

@bzha5848 yes, you can create any model by customizing a model yaml for it.

glenn-jocher avatar Sep 10 '22 10:09 glenn-jocher

Dear @bzha5848 ,

did you prepare the model for the efficientnet? if yes, would you share it with me as well?

Thank you

bakikocabasa avatar Sep 17 '22 14:09 bakikocabasa

Dear @glenn-jocher ,

we have weight-anymodel.yaml connections between yolov5n-s-m-l-x,pt and their yaml files. However, when I want to use efficientnet.pt in train, it returns an error.

Traceback (most recent call last): File "train.py", line 630, in main(opt) File "train.py", line 526, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 123, in train model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1208, in getattr type(self).name, name)) AttributeError: 'EfficientNet' object has no attribute 'yaml'

How can I overcome this issue?

bakikocabasa avatar Sep 17 '22 14:09 bakikocabasa

@bakikocabasa for torchvision models we just load them directly from torchvision, so we don't have model yaml's available unfortunately: https://github.com/ultralytics/yolov5/blob/6a9fffd19a96799c683c94d2d4da8c453e819116/classify/train.py#L111-L112

glenn-jocher avatar Sep 17 '22 18:09 glenn-jocher

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

  • Wiki – https://github.com/ultralytics/yolov5/wiki
  • Tutorials – https://docs.ultralytics.com/yolov5
  • Docs – https://docs.ultralytics.com

Access additional Ultralytics ⚡ resources:

  • Ultralytics HUB – https://ultralytics.com/hub
  • Vision API – https://ultralytics.com/yolov5
  • About Us – https://ultralytics.com/about
  • Join Our Team – https://ultralytics.com/work
  • Contact Us – https://ultralytics.com/contact

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

github-actions[bot] avatar Oct 18 '22 00:10 github-actions[bot]