Skip to content
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

[Fix] Fix typos in the YOLOv8 diagram #621

Merged
merged 2 commits into from
Mar 6, 2023

Conversation

RangeKing
Copy link
Collaborator

@RangeKing RangeKing commented Mar 3, 2023

Motivation

Fix typos in the YOLOv8 diagram.

Modification

Modify the channels after No.13 Upsample from 256 to 512, the channels after No.14 Concat from 512 to 768, and the channels after No.17 Concat from 512 to 768.

YOLOv8_structure_MMYOLO_v1.3

@qiujianchen
Copy link

麻烦再检查一下第17层是否有误,谢谢!

@RangeKing
Copy link
Collaborator Author

麻烦再检查一下第17层是否有误,谢谢!

抱歉,17 层输出应该为 768,已修正。

@hhaAndroid hhaAndroid merged commit 557f304 into open-mmlab:dev Mar 6, 2023
@yjh0410
Copy link

yjh0410 commented Mar 10, 2023

@hhaAndroid 您好,按照修正后的YOLOv8结构图来搭建网络,以YOLOv8-L为例,在640x640的输入下,参数量为59M,和官方的43M对不上,请问你们在训练模型时,有记录参数量和FLOPs的信息吗?

@RangeKing RangeKing deleted the fix-yolov8-diagram branch March 11, 2023 02:42
@RangeKing
Copy link
Collaborator Author

@yjh0410 你可以使用以下命令获得 YOLOv8l 的模型参数量(v0.5.0 或 dev 分支):

python tools/analysis_tools/get_flops.py configs/yolov8/yolov8_l_syncbn_fast_8xb16-500e_coco.py

输出结果如下,和官方的 43 M 是对应的:

+--------------------------------------+----------------------+------------+--------------+
| module                               | #parameters or shape | #flops     | #activations |
+--------------------------------------+----------------------+------------+--------------+
| model                                | 43.692M              | 82.725G    | 74.51M       |
|  backbone                            |  19.809M             |  42.901G   |  49.869M     |
|   backbone.stem                      |   1.856K             |   0.19G    |   6.554M     |
|    backbone.stem.conv                |    1.728K            |    0.177G  |    6.554M    |
|    backbone.stem.bn                  |    0.128K            |    13.107M |    0         |
|   backbone.stage1                    |   0.354M             |   9.057G   |   19.661M    |
|    backbone.stage1.0                 |    73.984K           |    1.894G  |    3.277M    |
|    backbone.stage1.1                 |    0.28M             |    7.163G  |    16.384M   |
|   backbone.stage2                    |   2.397M             |   15.339G  |   14.746M    |
|    backbone.stage2.0                 |    0.295M            |    1.891G  |    1.638M    |
|    backbone.stage2.1                 |    2.101M            |    13.448G |    13.107M   |
|   backbone.stage3                    |   9.577M             |   15.324G  |   7.373M     |
|    backbone.stage3.0                 |    1.181M            |    1.889G  |    0.819M    |
|    backbone.stage3.1                 |    8.397M            |    13.435G |    6.554M    |
|   backbone.stage4                    |   7.479M             |   2.992G   |   1.536M     |
|    backbone.stage4.0                 |    2.36M             |    0.944G  |    0.205M    |
|    backbone.stage4.1                 |    4.462M            |    1.785G  |    1.024M    |
|    backbone.stage4.2                 |    0.657M            |    0.263G  |    0.307M    |
|  neck                                |  18.238M             |  26.674G   |  18.022M     |
|   neck.top_down_layers               |   5.971M             |   15.544G  |   12.288M    |
|    neck.top_down_layers.0            |    4.724M            |    7.558G  |    4.096M    |
|    neck.top_down_layers.1            |    1.248M            |    7.986G  |    8.192M    |
|   neck.downsample_layers             |   2.951M             |   1.889G   |   0.614M     |
|    neck.downsample_layers.0          |    0.59M             |    0.945G  |    0.41M     |
|    neck.downsample_layers.1          |    2.36M             |    0.944G  |    0.205M    |
|   neck.bottom_up_layers              |   9.316M             |   9.238G   |   5.12M      |
|    neck.bottom_up_layers.0           |    4.593M            |    7.348G  |    4.096M    |
|    neck.bottom_up_layers.1           |    4.724M            |    1.889G  |    1.024M    |
|   neck.upsample_layers               |                      |   4.096M   |   0          |
|    neck.upsample_layers.0            |                      |    0.819M  |    0         |
|    neck.upsample_layers.1            |                      |    3.277M  |    0         |
|  bbox_head.head_module               |  5.644M              |  13.15G    |  6.619M      |
|   bbox_head.head_module.cls_preds    |   4.783M             |   11.269G  |   4.973M     |
|    bbox_head.head_module.cls_preds.0 |    1.201M            |    7.687G  |    3.789M    |
|    bbox_head.head_module.cls_preds.1 |    1.791M            |    2.866G  |    0.947M    |
|    bbox_head.head_module.cls_preds.2 |    1.791M            |    0.716G  |    0.237M    |
|   bbox_head.head_module.reg_preds    |   0.861M             |   1.88G    |   1.613M     |
|    bbox_head.head_module.reg_preds.0 |    0.189M            |    1.208G  |    1.229M    |
|    bbox_head.head_module.reg_preds.1 |    0.336M            |    0.538G  |    0.307M    |
|    bbox_head.head_module.reg_preds.2 |    0.336M            |    0.134G  |    76.8K     |
+--------------------------------------+----------------------+------------+--------------+


==============================
Input shape: torch.Size([640, 640])
Model Flops: 82.725G
Model Parameters: 43.692M
==============================
!!!Please be cautious if you use the results in papers. You may need to check if all ops are supported and verify that the flops computation is correct.

@yjh0410
Copy link

yjh0410 commented Mar 11, 2023

@RangeKing 好的,非常感谢!

@yjh0410
Copy link

yjh0410 commented Mar 11, 2023

@RangeKing 您好,再次打扰了~我之所没对上,是因为head部分按照YOLOX的思路了,但看了代码,发现YOLOv8的head参数设计是不一样的,现在完全对上了。希望大佬们可以修改一下图中的head部分,能加填一下详细的通道数变化,否则会误以为是retinanet那种decoupled head。

@RangeKing
Copy link
Collaborator Author

@RangeKing 您好,再次打扰了~我之所没对上,是因为head部分按照YOLOX的思路了,但看了代码,发现YOLOv8的head参数设计是不一样的,现在完全对上了。希望大佬们可以修改一下图中的head部分,能加填一下详细的通道数变化,否则会误以为是retinanet那种decoupled head。

通道数加上整体排版要大改,稍有些麻烦哈

@140ai
Copy link

140ai commented Aug 29, 2023

@RangeKing 您好,再次打扰了~我之所没对上,是因为head部分按照YOLOX的思路了,但看了代码,发现YOLOv8的head参数设计是不一样的,现在完全对上了。希望大佬们可以修改一下图中的head部分,能加填一下详细的通道数变化,否则会误以为是retinanet那种decoupled head。

通道数加上整体排版要大改,稍有些麻烦哈

请问用什么软件画网络结构图

@RangeKing
Copy link
Collaborator Author

@140ai 我是用 PPT 画的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants