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 "max_unpool2d" function #29

Open
ChenFan666 opened this issue Feb 28, 2022 · 4 comments
Open

About "max_unpool2d" function #29

ChenFan666 opened this issue Feb 28, 2022 · 4 comments

Comments

@ChenFan666
Copy link

When i use another backbone , i meet this problem:
image
I cheak the conv5_3.shape and id4.shape , they meet the requirements of the "max_unpool2d" function
image
Could you help me?please!

@Pongpisit-Thanasutives
Copy link
Owner

Based on the error message, casting the type of elements in id4 to be torch.int64 may solve the problem.

Like this ...
id4 = id4.type(torch.int64)

@ChenFan666
Copy link
Author

Thank you for your explanation, but after I made the modification, the following problems occurred
image
This is their shape:
image
I see this tensor have the same channel in your code, and i make my tensor's channel to same, but still report error

@ChenFan666
Copy link
Author

This my fault, i not use the maxpool,just want use the unmaxpool,thank you very much!

@Pongpisit-Thanasutives
Copy link
Owner

Pongpisit-Thanasutives commented Mar 1, 2022

That's fine. The max_unpool is used together with the max_pooling operation.
You may see https://pytorch.org/docs/stable/generated/torch.nn.MaxUnpool2d.html.
And, the indices should be positive integers.

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