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

How to calculate the input_size according to the data shape? #50

Open
Overflowu7 opened this issue Aug 3, 2023 · 3 comments
Open

How to calculate the input_size according to the data shape? #50

Overflowu7 opened this issue Aug 3, 2023 · 3 comments

Comments

@Overflowu7
Copy link

I see the input_size is different in the different datasets. For example, the input_size in adac is :
class UnetrPPEncoder(nn.Module):
def init(self, input_size=[16 * 40 * 40, 8 * 20 * 20, 4 * 10 * 10, 2 * 5 * 5],dims=[32, 64, 128, 256],
proj_size =[64,64,64,32], depths=[3, 3, 3, 3], num_heads=4, spatial_dims=3, in_channels=1,
dropout=0.0, transformer_dropout_rate=0.1 ,kwargs):
super().init()

and I check the shape of the acdc is [216,256,10].So i'm confused because the shape of data always miss match the embedding size like this:
File "/home/unetrpp/transformerblock.py", line 60, in forward
x = x + self.pos_embed
RuntimeError: The size of tensor a (27648) must match the size of tensor b (25600) at non-singleton dimension 1
Can you tell me how to solve this problem??

@Amshaker
Copy link
Owner

Amshaker commented Aug 8, 2023

Hi @Overflowu7 ,

Yes, the shape of data for ACDC is 16 * 40 * 40 for the first stage.

How do you get the shape of the acdc is [216,256,10]?

@annacga
Copy link

annacga commented Nov 12, 2024

I have the same problem @Overflowu7 if you managed to fix the problem, could you provide some insights?

@q1556450920
Copy link

Change the patch_size in plan.pkl

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