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

About the hard anchor samping #43

Open
leeh43 opened this issue Feb 26, 2022 · 3 comments
Open

About the hard anchor samping #43

leeh43 opened this issue Feb 26, 2022 · 3 comments

Comments

@leeh43
Copy link

leeh43 commented Feb 26, 2022

Hi, thank you for the great work. I am currently using your pipeline on my dataset. I have a question about the hard anchor sampling function. As the label (128 x 128) is resampled to the feature size (16 x 16), the segmentation prediction from the model is not resampled and it pops up an error of different dimensions between labels and predictions in the following line:

hard_indices = ((this_y_hat == cls_id) & (this_y != cls_id)).nonzero()

Is there anything that I can do to fix the error?

Thank you so much!

@hhxzzy
Copy link

hhxzzy commented Mar 1, 2022

I met the same problem before. I think this may because the stride of your backbone network is different from the author's.
You can try resizing the labels, features and predictions to the same size to see if it works.

@wcyjerry
Copy link

wcyjerry commented Mar 7, 2022

I met the problem, and It's because ur decoder have already upsample the predictions, like after the encoder maybe the feature_map's h w is 16X16 , so the embed is bsXembed_dimX16X16, but if your decoder upsample the feature_map maybe ur prediction is like 128X128, this would report an error.
the solution is resize your prediction to the same size as the embed like the way to do with labels

@lennart-maack
Copy link

@tfzhou Does the proposed solution from @q671383789 answers the question? Thanks a lot for your great work!

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

4 participants