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

model size was not changed by reduce the crop size and resize #144

Closed
huang45 opened this issue Sep 22, 2020 · 3 comments
Closed

model size was not changed by reduce the crop size and resize #144

huang45 opened this issue Sep 22, 2020 · 3 comments

Comments

@huang45
Copy link

huang45 commented Sep 22, 2020

changes in the config file:

crop_size = (512, 512)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='Resize', img_scale=(860, 540), ratio_range=(0.5, 2.0)),
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='PhotoMetricDistortion'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_semantic_seg']),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(860, 540),
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', **img_norm_cfg),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img']),
])
]

but the model size was not changed.
The input shape was not changed:

Input shape: (3, 2048, 1024)
Flops: 7.53 GFLOPs
Params: 1.21 M

@xvjiarui
Copy link
Collaborator

Hi @huang45
Are you using tools/get_flops.py? If so, you may try passing --shape 860 540

@huang45
Copy link
Author

huang45 commented Sep 24, 2020

@xvjiarui Yes. By adding --shape 860 540, the Flops is reduced to 1.69 GFLOPs, but the Params is same. The pth file size is also not changed. Is it normal? thanks.

Input shape: (3, 860, 540)
Flops: 1.69 GFLOPs
Params: 1.21 M

@xvjiarui
Copy link
Collaborator

Hi @huang45
The model size or the number of params is not related to input size.

MeowZheng added a commit that referenced this issue Dec 6, 2022
CodeCamp #144 [Doc] Chinese version of config tutorial
MeowZheng pushed a commit to MeowZheng/mmsegmentation that referenced this issue Dec 30, 2022
…-mmlab#2371

* [Doc]Translate the 1_config.md and modify a wrong statement in 1_config.md

* Translate the 1_config.md and modify a wrong statement in 1_config.md

* Modify some expressions

* Apply suggestions from code review
MeowZheng pushed a commit that referenced this issue Dec 30, 2022
* [Doc]Translate the 1_config.md and modify a wrong statement in 1_config.md

* Translate the 1_config.md and modify a wrong statement in 1_config.md

* Modify some expressions

* Apply suggestions from code review
wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this issue Dec 3, 2023
Co-authored-by: jinsheng <jinsheng@sensetime.com>
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this issue Apr 5, 2024
* [Doc]Translate the 1_config.md and modify a wrong statement in 1_config.md

* Translate the 1_config.md and modify a wrong statement in 1_config.md

* Modify some expressions

* Apply suggestions from code review
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

No branches or pull requests

2 participants