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

runtime error in haca3-test version 1.0.7 related to dimensions #3

Open
ibrwr opened this issue Dec 12, 2023 · 2 comments
Open

runtime error in haca3-test version 1.0.7 related to dimensions #3

ibrwr opened this issue Dec 12, 2023 · 2 comments

Comments

@ibrwr
Copy link

ibrwr commented Dec 12, 2023

Running haca3-test with tag 1.0.4 runs without any problems, but when repeating the same command with 1.0.7 the script gives a runtime error related to dimensions, see below:

haca3-test --in-path $(pwd)/sub-75_ses-tp1_acq-ge_run-1_T1w_2_hacamni.nii.gz --target-theta 0.306601 9.588893 --harmonization-model /somepath/apptainer/haca3/data/harmonization_public.pt --fusion-model /somepath/apptainer/haca3/data/fusion.pt --out-path siemens2hac3 --intermediate-out-dir ./tmp/
========== BEGIN HACA3 HARMONIZATION ==========
Traceback (most recent call last):
File "/somepath/haca3/haca3_venv/bin/haca3-test", line 8, in
sys.exit(main())
File "/somepath/haca3/haca3_venv/lib64/python3.9/site-packages/haca3/test.py", line 120, in main
haca3 = HACA3(beta_dim=args.beta_dim,
File "/somepath/haca3/haca3_venv/lib64/python3.9/site-packages/haca3/modules/model.py", line 53, in init
self.decoder.load_state_dict(self.checkpoint['decoder'])
File "/somepath/haca3/haca3_venv/lib64/python3.9/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for UNet:
size mismatch for in_conv.weight: copying a param with shape torch.Size([8, 3, 3, 3]) from checkpoint, the shape in current model is torch.Size([16, 3, 3, 3]).
size mismatch for in_conv.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([16]).
size mismatch for down_convs.0.conv.0.weight: copying a param with shape torch.Size([16, 8, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 16, 3, 3]).
size mismatch for down_convs.0.conv.0.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]).
size mismatch for down_convs.0.conv.3.weight: copying a param with shape torch.Size([16, 16, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 32, 3, 3]).
size mismatch for down_convs.0.conv.3.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]).
size mismatch for down_convs.1.conv.0.weight: copying a param with shape torch.Size([32, 16, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 32, 3, 3]).
size mismatch for down_convs.1.conv.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for down_convs.1.conv.3.weight: copying a param with shape torch.Size([32, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]).
size mismatch for down_convs.1.conv.3.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for down_convs.2.conv.0.weight: copying a param with shape torch.Size([64, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 64, 3, 3]).
size mismatch for down_convs.2.conv.0.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for down_convs.2.conv.3.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]).
size mismatch for down_convs.2.conv.3.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for down_convs.3.conv.0.weight: copying a param with shape torch.Size([128, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 128, 3, 3]).
size mismatch for down_convs.3.conv.0.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for down_convs.3.conv.3.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 3, 3]).
size mismatch for down_convs.3.conv.3.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for up_samples.0.conv.0.weight: copying a param with shape torch.Size([16, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 64, 3, 3]).
size mismatch for up_samples.0.conv.0.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]).
size mismatch for up_samples.1.conv.0.weight: copying a param with shape torch.Size([32, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 128, 3, 3]).
size mismatch for up_samples.1.conv.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for up_samples.2.conv.0.weight: copying a param with shape torch.Size([64, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 256, 3, 3]).
size mismatch for up_samples.2.conv.0.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for up_samples.3.conv.0.weight: copying a param with shape torch.Size([128, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 512, 3, 3]).
size mismatch for up_samples.3.conv.0.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for up_convs.0.conv.0.weight: copying a param with shape torch.Size([16, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 64, 3, 3]).
size mismatch for up_convs.0.conv.0.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]).
size mismatch for up_convs.0.conv.3.weight: copying a param with shape torch.Size([16, 16, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 32, 3, 3]).
size mismatch for up_convs.0.conv.3.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]).
size mismatch for up_convs.1.conv.0.weight: copying a param with shape torch.Size([32, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 128, 3, 3]).
size mismatch for up_convs.1.conv.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for up_convs.1.conv.3.weight: copying a param with shape torch.Size([32, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]).
size mismatch for up_convs.1.conv.3.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for up_convs.2.conv.0.weight: copying a param with shape torch.Size([64, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 256, 3, 3]).
size mismatch for up_convs.2.conv.0.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for up_convs.2.conv.3.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]).
size mismatch for up_convs.2.conv.3.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for up_convs.3.conv.0.weight: copying a param with shape torch.Size([128, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 512, 3, 3]).
size mismatch for up_convs.3.conv.0.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for up_convs.3.conv.3.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 3, 3]).
size mismatch for up_convs.3.conv.3.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for bottleneck_conv.conv.0.weight: copying a param with shape torch.Size([256, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 256, 3, 3]).
size mismatch for bottleneck_conv.conv.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for bottleneck_conv.conv.3.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]).
size mismatch for bottleneck_conv.conv.3.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for out_conv.0.weight: copying a param with shape torch.Size([8, 16, 3, 3]) from checkpoint, the shape in current model is torch.Size([16, 32, 3, 3]).
size mismatch for out_conv.0.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([16]).
size mismatch for out_conv.2.weight: copying a param with shape torch.Size([1, 8, 3, 3]) from checkpoint, the shape in current model is torch.Size([1, 16, 3, 3]).

@ibrwr ibrwr changed the title runtime error in version 1.0.7 related to dimensions runtime error in haca3-test version 1.0.7 related to dimensions Dec 12, 2023
@j-tseng
Copy link

j-tseng commented Dec 18, 2023

Getting a similar error using the provided singularity image under section 3.1 of the README. I'm guessing the v1.0.9 beta-dimension bug fix addresses this - any chance you'll update the singularity image too? Thanks and eager to try this out!

@lianruizuo
Copy link
Owner

Thanks for the comments. We have fixed the dimension issue in v1.0.9 and provided an updated link for v1.0.9 singularity.

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

3 participants