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 index error when using multi-samplers strategy #2094

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

zhangtingyu11
Copy link
Contributor

@zhangtingyu11 zhangtingyu11 commented Jul 2, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

fix index error when using multi-samplers strategy

Modification

Just change index from last_fps_end_index:fps_sample_range to last_fps_end_index:fps_sample_range +last_fps_end_index based on the issue #2082

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with some of those projects, like MMDet or MMCls.
  • CLA has been signed and all committers have signed the CLA in this PR.

@CLAassistant
Copy link

CLAassistant commented Jul 2, 2022

CLA assistant check
All committers have signed the CLA.

@HAOCHENYE
Copy link
Collaborator

Thanks for your contribution~~.
I think fps_sample_range_list should be a list of indexes represented for the target range of sampled points.
For example, when fps_sample_range_list=-1 (default value), it means it will sample the points from the first(index: 0) to the last(index: -1):
Besides, fps_sample_range_list has the key word: range, just like Python built-in range, it should accept the arguments which mean the first index and the last index.

But this pr seems to assume fps_sample_range_list is a list, and each element means the number of sampled. I think it is not consistent with its default value and argument name.

What do you think of it?

@zhangtingyu11
Copy link
Contributor Author

zhangtingyu11 commented Jul 4, 2022

Thanks for your contribution~~. I think fps_sample_range_list should be a list of indexes represented for the target range of sampled points. For example, when fps_sample_range_list=-1 (default value), it means it will sample the points from the first(index: 0) to the last(index: -1): Besides, fps_sample_range_list has the key word: range, just like Python built-in range, it should accept the arguments which mean the first index and the last index.

But this pr seems to assume fps_sample_range_list is a list, and each element means the number of sampled. I think it is not consistent with its default value and argument name.

What do you think of it?

You are right.I have changed index when updating last_fps_end_index.For example, if there are 3000 points,and the fps_sample_list is [1000,2000,3000].The last_fps_end_index will be 0,1000,2000 in each loop,and the points should be choosen with index in (0~1000),(1000~2000),(2000~3000).I think this matches your idea.

@HAOCHENYE
Copy link
Collaborator

LGTM.

@zhouzaida zhouzaida changed the title fix index error when using multi-samplers strategy [Fix] Fix index error when using multi-samplers strategy Jul 6, 2022
@zhouzaida zhouzaida merged commit d77557b into open-mmlab:master Jul 6, 2022
@yaqi0510
Copy link

yaqi0510 commented Apr 3, 2023

zhangtingyu11,您好!您在MMCV项目中给我们提的PR非常重要,感谢您付出私人时间帮助改进开源项目,相信很多开发者会从你的PR中受益。
我们非常期待与您继续合作,OpenMMLab专门成立了贡献者组织MMSIG,为贡献者们提供开源证书、荣誉体系和专享好礼,可通过添加微信:openmmlabwx 联系我们(请备注mmsig+GitHub id),由衷希望您能加入!

Hi @zhangtingyu11 !First of all, we want to express our gratitude for your significant PR in the MMcv project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR.

We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/raweFPmdzG

If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)
Thank you again for your contribution❤

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.

5 participants