david-stojanovski / E-Pix2Vox-reconstruction

Code to implement "Efficient Pix2Vox++ for 3D Cardiac Reconstruction from 2D echo views"
MIT License
18 stars 4 forks source link

Issue with Model_Size = 128, 32. #4

Open saadz-khan opened 1 year ago

saadz-khan commented 1 year ago

I have been able to make

Model_size=64 work perfectly and seamlessly and achieving a IoU of 0.808 almost.

Is the 128 the EpiVox/Accurate model? Now I have been having shape and size issues with the decoder128.py. BCEloss requires both shape to match but unfortunately the generated_volumes variable has shape which is incorrect. How can I fix this? Do I need to change the decoder128 code. I need help. Thanks. I really appreciate your help and input.

Shape of the following variables at line 216 in train.py

generated_volume =  torch.Size([5, 128, 128, 128])
ground_truth_volumes = torch.Size([5, 64, 64, 64])
Traceback (most recent call last):
  File "/content/drive/MyDrive/Med/E-Pix2Vox-reconstruction/e_pivox/runner.py", line 88, in <module>
    main()
  File "/content/drive/MyDrive/Med/E-Pix2Vox-reconstruction/e_pivox/runner.py", line 74, in main
    train_net(cfg)
  File "/content/drive/MyDrive/Med/E-Pix2Vox-reconstruction/e_pivox/core/train.py", line 216, in train_net
    encoder_loss = loss_func(generated_volumes, ground_truth_volumes) * 10
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/loss.py", line 619, in forward
    return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py", line 3089, in binary_cross_entropy
    raise ValueError(
ValueError: Using a target size (torch.Size([5, 64, 64, 64])) that is different to the input size (torch.Size([5, 128, 128, 128])) is deprecated. Please ensure they have the same size.