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

Please tell me. I see that your data preprocessing is processed as uint8. I want to process lung data. The uint8 precision lung details will be lost. Is it okay if I save it as float32? After trying it, it seems that the GPU will overrun. #3

Open
yuanpengpeng opened this issue Jan 10, 2024 · 1 comment

Comments

@yuanpengpeng
Copy link

yuanpengpeng commented Jan 10, 2024

Error reported during testing

Namespace(name='dif-net', epoch=400, dst_list='knee_cbct', split='test', combine='mlp', num_views=3, view_offset=0, out_res=256, eval_npoint=100000, visualize=False)
mixed_dataset: ['knee_cbct']
输出dst_name: knee_cbct
CBCT_dataset, name: knee_cbct, split: test, len: 1.
load ckpt from /mnt/d/谷歌下载/DIF-Net-main/DIF-Net-main/scripts/logs/dif-net/ep_400.pth
DIF_Net, mid_ch: 128, combine: mlp
Traceback (most recent call last):
File "/mnt/d/谷歌下载/DIF-Net-main/DIF-Net-main/code/evaluate.py", line 110, in
model.load_state_dict(ckpt)
File "/home/yuanpeng/conda/envs/python310Tigre/lib/python3.10/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 DIF_Net:
size mismatch for view_mixer.layer.0.weight: copying a param with shape torch.Size([5, 10, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for view_mixer.layer.0.bias: copying a param with shape torch.Size([5]) from checkpoint, the shape in current model is torch.Size([1]).
size mismatch for view_mixer.layer.2.weight: copying a param with shape torch.Size([1, 5, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).

    May I ask what is the reason for this? I followed the same data preprocessing steps and ran it on the 3090ti server and 24g video memory.
@lyqun
Copy link
Collaborator

lyqun commented Jan 15, 2024

To convert the data to uint8, you should

  1. normalize the value scale of the data to [0, 1];
  2. multiply the data by a factor of 255;
  3. convert the data type to uint8.

Float32 is fine, but more memory is required and the data loading is much slower.

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