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

A little error report about BaseHead and HeatmapHead class in mmpose 1.0.0 rc #1838

Closed
xinxinxinxu opened this issue Nov 24, 2022 · 2 comments
Assignees
Labels
info/1.x Issue/PR related to branch 1.x

Comments

@xinxinxinxu
Copy link
Contributor

I wonder if anyone has encountered a similar problem when using a single-resolution pred map to consulate mseloss , there will report that tensors size mismatch between preds and gt.
For instance, the output of the backbone is not a list but a tensor, like (64, 32, 64, 64). When it is processed by the __transform_inputs function(a private function of BaseHead class), it will lose a dimension, like turning to (16, 64, 64).

However, this error does not exist in the previous version. I found this is because there is a conditional statement that was missing in the new version, after adding it, the error will no longer be reported.

Original:
image

Modified:
image

Thanks to the developers for their contributions!
Hope this report is helpful for everyone!

@Ben-Louis
Copy link
Collaborator

Hi, thanks for using MMPose. In MMPose 1.x, the default output of the backbone is a tuple, with which heads are designed to deal. For example, the raw output of Resnet50 (a tensor) will be packed into a tuple with length 1, and will be unpacked in xxhead._transform_inputs with parameters input_transform='select' and input_index=-1.

But I think your modification makes sense. Because the output of most backbones that are not implemented in MMPose is a tensor. If users want to try some advanced networks in pose estimation with MMPose, they should not be bothered by this adaptation problem. What do you think? @ly015

@ly015 ly015 added the info/1.x Issue/PR related to branch 1.x label Nov 25, 2022
@ly015
Copy link
Member

ly015 commented Nov 25, 2022

@xinxinxinxu Thanks for reporting this issue. The modification is indeed necessary for users who would like to implement their own backbone.

Would you be willing to submit a pull request to MMPose dev-1.x branch to fix this issue? A brief guide to contributing codes to MMPose can be found at: https://mmpose.readthedocs.io/en/dev-1.x/notes/contribution_guide.html. Your contribution would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info/1.x Issue/PR related to branch 1.x
Projects
None yet
Development

No branches or pull requests

4 participants