-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace backbone #6003
Comments
👋 Hello @Chengcheng1998727, 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://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started: $ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf 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), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@Chengcheng1998727 part of the complication with backbone replacement is that YOLO requires skip connections from the backbone to the head in various places, and of course these must meet shape/stride constraints otherwise errors like this will appear. |
👋 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:
Access additional Ultralytics ⚡ resources:
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 ⭐! |
How can I use Resenet 50 as the backbone of Yolov5? |
same question |
سلام وقت بخیر |
@hojat-ardi hello! Thank you for your interest in YOLOv5 and your question about using Resnet50 as the backbone. To use Resnet50 as the backbone in YOLOv5, you need to make modifications to the YOLOv5 code. Here are the general steps:
Keep in mind that making such changes may require additional modifications to ensure the compatibility of the model. You might need to adjust the shape/stride constraints and handle any errors or inconsistencies that arise. Please note that while this approach can be used as a starting point, it requires careful consideration and testing to ensure that the modified model functions correctly. I hope this helps! If you have any further questions, please let me know. |
برای ایجاد تغییرات در Backbone باید در فایل yolov5.yaml در فولدر models
تغییرات را ایجاد کنید.
…On Thu, Jul 6, 2023 at 3:57 AM hrd ***@***.***> wrote:
@Chengcheng1998727 <https://github.com/Chengcheng1998727> part of the
complication with backbone replacement is that YOLO requires skip
connections from the backbone to the head in various places, and of course
these must meet shape/stride constraints otherwise errors like this will
appear.
How can I use Resenet 50 as the backbone of Yolov5?
سلام وقت بخیر
من میخوام backbone yolo رو تغییر بدم.
به مشکل خوردم
امکانش هست به بنده کمک کنید؟
آدرس ایمیل بنده: hojat.ardi.aut.ac.ir
—
Reply to this email directly, view it on GitHub
<#6003 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASMY6LZ6QEPIOXQO33ARWRLXOYA7VANCNFSM5KFVR76A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@marziyemahmoudifar برای ایجاد تغییرات در backbone در YOLOv5 میتوانید تغییرات را در فایل توجه داشته باشید که با تغییر backbone، ممکن است نیاز به تغییر دیگر متدل ها و قسمتهای مربوطه باشد تا اطمینان حاصل شود که مدل به درستی کار میکند. با انجام این تغییرات بیشتر مدل YOLOv5 شما تغییر داده خواهد شد اما اگر طبق دستورالعمل بالا از ک |
خواهر عزیز میشه بیشتر توضیح بدی چطور این کار رو انجام بدم من دارم برای دکترا در عراق میخونم و روی توسعه ستون فقرات یولو کار میکنم.بابت زبانم متاسفم من از گوگل برای ترجمه استفاده میکنم. |
@glenn-jocher where to change to Resnet50 ? where is this choice on what path please? and what other choices i could make besides Resnet50 |
در فایل yolov5.yaml تمام شبکه های کانولوشنی و ماژول های مورد استفاده در بخش
ستون فقرات و گردن و سر یولو به همراه آرگومان های ورودی قرار گرفته اند.
ماژول ها و لایه های کانولوشنی که در این فایل هستند از فایل common.py
فراخوانی میشوند. اگر میخواهید تغییراتی در ستون فقرات شبکه ایجاد کنید برای
مثال از ماژول جدیدی بجای ماژول C3 در ستون فقرات استفاده کنید ابتدا باید
تابع ماژول جدید را در فایل common.py بنویسید و سپس آن را در فایل
yolov5.yaml قرار دهید.
…On Fri, Jul 7, 2023 at 18:27 moahaimen ***@***.***> wrote:
خواهر عزیز میشه بیشتر توضیح بدی چطور این کار رو انجام بدم من دارم برای
دکترا در عراق میخونم و روی توسعه ستون فقرات یولو کار میکنم.بابت زبانم
متاسفم من از گوگل برای ترجمه استفاده میکنم.
—
Reply to this email directly, view it on GitHub
<#6003 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASMY6LZVWAFSYF3S6YFFOGDXPAPTZANCNFSM5KFVR76A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
خواهر گرامی ترجمه به وضوح به دست من نرسید و من چیزی نفهمیدم درخت خرما چه نسبتی با معماری یولو دارد؟ |
In the yolov5.yaml file, all the convolutional layers and modules used in
the backbone,neck and head of Yolo are placed along with the input
arguments. The modules and convolution layers that are in this file are
called from the common.py file. If you want to make changes in the backbone
of the network, for example, use a new module instead of the C3 module in
the backbone, you must first write the function of the new module in the
common.py file and then put it in the yolov5.yaml file.
…On Fri, Jul 7, 2023 at 19:06 moahaimen ***@***.***> wrote:
در فایل yolov5.yaml تمام شبکه های کانولوشنی و ماژول های مورد استفاده در
بخش ستون فقرات و گردن و سر یولو به همراه آرگومان های ورودی قرار گرفته اند.
ماژول ها و لایه های کانولوشنی که در این فایل هستند از فایل common.py
فراخوانی میشوند. اگر میخواهید تغییراتی در ستون فقرات شبکه ایجاد کنید برای
مثال از ماژول جدیدی بجای ماژول C3 در ستون فقرات استفاده کنید ابتدا باید
تابع ماژول جدید را در فایل common.py بنویسید و سپس آن را در فایل
yolov5.yaml قرار دهید.
… <#m_-4144234384128232094_>
On Fri, Jul 7, 2023 at 18:27 moahaimen *@*.*> wrote: خواهر عزیز میشه
بیشتر توضیح بدی چطور این کار رو انجام بدم من دارم برای دکترا در عراق میخونم
و روی توسعه ستون فقرات یولو کار میکنم.بابت زبانم متاسفم من از گوگل برای
ترجمه استفاده میکنم. — Reply to this email directly, view it on GitHub
<#6003 (comment)
<#6003 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASMY6LZVWAFSYF3S6YFFOGDXPAPTZANCNFSM5KFVR76A
<https://github.com/notifications/unsubscribe-auth/ASMY6LZVWAFSYF3S6YFFOGDXPAPTZANCNFSM5KFVR76A>
. You are receiving this because you were mentioned.Message ID: @.*>
خواهر گرامی ترجمه به وضوح به دست من نرسید و من چیزی نفهمیدم درخت خرما چه
نسبتی با معماری یولو دارد؟
—
Reply to this email directly, view it on GitHub
<#6003 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASMY6L4KJHTN7B6ZXQAZFR3XPAUIRANCNFSM5KFVR76A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
thank you for explaining,yes i build 2 blocks and added them in blocks.py, but failed to call them in yolo.yaml , and when call them several errors happens , also i tried to add or delete any layers in yolo.yaml , a tensor shape size appeared i couldn't fix, if you can help me i would really appreciate it, |
If you share errors, maybe I can help you.
…On Fri, Jul 7, 2023 at 19:48 moahaimen ***@***.***> wrote:
In the yolov5.yaml file, all the convolutional layers and modules used in
the backbone,neck and head of Yolo are placed along with the input
arguments. The modules and convolution layers that are in this file are
called from the common.py file. If you want to make changes in the backbone
of the network, for example, use a new module instead of the C3 module in
the backbone, you must first write the function of the new module in the
common.py file and then put it in the yolov5.yaml file.
… <#m_-293272555951377886_>
On Fri, Jul 7, 2023 at 19:06 moahaimen *@*.*> wrote: در فایل yolov5.yaml
تمام شبکه های کانولوشنی و ماژول های مورد استفاده در بخش ستون فقرات و گردن و
سر یولو به همراه آرگومان های ورودی قرار گرفته اند. ماژول ها و لایه های
کانولوشنی که در این فایل هستند از فایل common.py فراخوانی میشوند. اگر
میخواهید تغییراتی در ستون فقرات شبکه ایجاد کنید برای مثال از ماژول جدیدی
بجای ماژول C3 در ستون فقرات استفاده کنید ابتدا باید تابع ماژول جدید را در
فایل common.py بنویسید و سپس آن را در فایل yolov5.yaml قرار دهید. …
<#m_-4144234384128232094_> On Fri, Jul 7, 2023 at 18:27 moahaimen @.>
wrote: خواهر عزیز میشه بیشتر توضیح بدی چطور این کار رو انجام بدم من دارم
برای دکترا در عراق میخونم و روی توسعه ستون فقرات یولو کار میکنم.بابت زبانم
متاسفم من از گوگل برای ترجمه استفاده میکنم. — Reply to this email directly,
view it on GitHub <#6003
<#6003> (comment) <#6003
(comment)
<#6003 (comment)>>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASMY6LZVWAFSYF3S6YFFOGDXPAPTZANCNFSM5KFVR76A
<https://github.com/notifications/unsubscribe-auth/ASMY6LZVWAFSYF3S6YFFOGDXPAPTZANCNFSM5KFVR76A>
https://github.com/notifications/unsubscribe-auth/ASMY6LZVWAFSYF3S6YFFOGDXPAPTZANCNFSM5KFVR76A
<https://github.com/notifications/unsubscribe-auth/ASMY6LZVWAFSYF3S6YFFOGDXPAPTZANCNFSM5KFVR76A>
. You are receiving this because you were mentioned.Message ID: @.> خواهر
گرامی ترجمه به وضوح به دست من نرسید و من چیزی نفهمیدم درخت خرما چه نسبتی با
معماری یولو دارد؟ — Reply to this email directly, view it on GitHub <#6003
(comment)
<#6003 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASMY6L4KJHTN7B6ZXQAZFR3XPAUIRANCNFSM5KFVR76A
<https://github.com/notifications/unsubscribe-auth/ASMY6L4KJHTN7B6ZXQAZFR3XPAUIRANCNFSM5KFVR76A>
. You are receiving this because you were mentioned.Message ID: @.***>
thank you for explaining,yes i build 2 blocks and added them in blocks.py,
but failed to call them in yolo.yaml , and when call them several errors
happens , also i tried to add or delete any layers in yolo.yaml , a tensor
shape size appeared i couldn't fix, if you can help me i would really
appreciate it,
—
Reply to this email directly, view it on GitHub
<#6003 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASMY6L3PRDETYAD6V3B2Y23XPAZFHANCNFSM5KFVR76A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@marziyemahmoudifar if you're experiencing errors when trying to call your custom modules in yolo.yaml, I can help you troubleshoot the issue. Could you please provide more details about the errors you are encountering? Additionally, if you could share the specific changes you made in blocks.py and yolo.yaml, it would be helpful for understanding the problem. |
@moahaimen لكن مدا اعرف شلون اذا ممكن اتواصل وياك backbone و اريد اغير yolov8 السلام عليكم اخوية اني ايضا اشتغل على موضوع |
مرحبًا @itmr97، للتواصل ومعرفة كيفية تغيير بنية الـ backbone من YOLOv5 إلى YOLOv8، يُنصح بإنشاء سؤالك كـ issue جديد في مستودع المشروع YOLOv5 على GitHub حتى يتمكن المطورون والمشاركون المتخصصون في المشروع من مساعدتك بشكل فعال. شكرًا لك على استخدام YOLOv5 وحظًا موفقًا في أبحاثك الدكتوراه. مع خالص التحية، |
هلو اخوية اني نجحت بالمووضوع والحمدلله طبعا ساعدني السيد @glenn-jocher كثيرا شكرا وتقدير له , لكن اني بموضوع كتابة الاطروحة الخاصة بي لشهادة الدكتوراة, عموما شتحب اساعدك بالضبط؟ moahaimen@gmail.com |
@moahaimen hello, Glad to hear that you were successful in your task and that Mr. Glenn was able to assist you effectively. Congratulations! Regarding your offer to help, we appreciate your willingness to contribute. If there are any specific questions or issues related to YOLOv5 that you would like to address, please feel free to share them in this thread or open a new GitHub issue. We'll do our best to assist you. Thank you for your support and congratulations again on your progress with your PH.D thesis. Best regards, |
@moahaimen ارسلتك ايميل استاذ مهيمن |
Hello @itmr97, Thank you for reaching out. I have received your email and will respond to you shortly. Please be patient as I review your message and gather any necessary information to assist you. Best, |
thank you very much |
@hojat-ardi You're welcome! We're glad that our response was helpful to you. If you have any further questions or need any more assistance, please don't hesitate to ask. We're here to help! Thank you and have a great day! |
أهلا اخ مهيمن. ويارب دراستك ماشية تمام. حاولت اغير ال backbone الى Resnet50 لكن ماقدرت...احتاج مساعدة اذا زبطت معاك |
@NasserAi hello! 🌟 Using ResNet 50 as the backbone for YOLOv5 involves modifying the model architecture to incorporate ResNet 50. Here's a simplified approach to get you started:
Remember, aligning the dimensions and feature maps from the backbone to the YOLO head is crucial. If you encounter any shape/stride errors, double-check the connections and layer outputs. Since you've mentioned having trouble with this step, could you share any specific errors or issues you're facing? This will help in providing more targeted advice. Good luck with your project, and don't hesitate to reach out for more assistance. |
Search before asking
Question
sir,I recently wanted to replace the backbone of yolov5 with resnet101, but there was an error that bothered me. This is the problem:
Traceback (most recent call last):
File "G:\Chengcheng\yolov5-5.0\models\yolo.py", line 93, in init
m.stride = torch.tensor([s / x.shape[-2] for x in self.forward(torch.zeros(1, ch, s, s))]) # forward
File "G:\Chengcheng\yolov5-5.0\models\yolo.py", line 123, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "G:\Chengcheng\yolov5-5.0\models\yolo.py", line 139, in forward_once
x = m(x) # run
File "E:\anaconda\anaconda\envs\cc2\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\anaconda\anaconda\envs\cc2\lib\site-packages\torch\nn\modules\container.py", line 117, in forward
input = module(input)
File "E:\anaconda\anaconda\envs\cc2\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "G:\Chengcheng\yolov5-5.0\models\common.py", line 97, in forward
x = self.conv2(x)
File "E:\anaconda\anaconda\envs\cc2\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\anaconda\anaconda\envs\cc2\lib\site-packages\torch\nn\modules\conv.py", line 423, in forward
return self._conv_forward(input, self.weight)
File "E:\anaconda\anaconda\envs\cc2\lib\site-packages\torch\nn\modules\conv.py", line 419, in _conv_forward
return F.conv2d(input, weight, self.bias, self.stride,
RuntimeError: Given groups=1, weight of size [80, 320, 3, 3], expected input[1, 80, 61, 61] to have 320 channels, but got 80 channels instead
I really hope you can help me solve this problem
Additional
No response
The text was updated successfully, but these errors were encountered: