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

pytorch bindings #508

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

pytorch bindings #508

wants to merge 7 commits into from

Conversation

Emvlt
Copy link

@Emvlt Emvlt commented Nov 29, 2023

Bug appears only in 3D

@AnderBiguri AnderBiguri changed the title pytorch bindings:3D bug pytorch bindings Nov 29, 2023
@AnderBiguri
Copy link
Member

Thanks @Emvlt , I'll have a look. AFAIK: 2D works, 3D crashes.

@Emvlt
Copy link
Author

Emvlt commented Nov 29, 2023

So, the crash only happens when forward is called a second time. I can compute a first forward pass exactly the way it should be, but the second call always crashes in 3D. The problematic line is
x = x.detach().cpu().numpy()

@AnderBiguri
Copy link
Member

I am a bit confused on the different way you tread the 3D version and the 2D version, can you explain further?

In TIGRE, there is no 2D operators, there are only 3D operators that can take 3 rd dimension == 1, so a priori, there is no need to change anything in the way you call Ax().

Would it not make it easier to treat these the same way? i.e. always assume you get a 3D tensor (+batch) as input. This makes it 4D for the THREE_D image case right? why do you have 5D sometimes in the THREE_D case?

@AnderBiguri
Copy link
Member

Maybe its because of #509

@Emvlt
Copy link
Author

Emvlt commented Dec 12, 2023

This pull request accounts for:

  • Forward and Backward Operators as torch.nn.Modules
  • Demo 23: CT reconstruction by iterative data discrepancy minimisation (there is a TODO for @AnderBiguri in this file + there is a known bug for 3D)
  • Demo 24: LPD training on MNIST data

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

Successfully merging this pull request may close these issues.

None yet

2 participants