CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox
BSD 3-Clause "New" or "Revised" License
527 stars 180 forks source link

pytorch bindings #508

Closed Emvlt closed 3 days ago

Emvlt commented 7 months ago

Bug appears only in 3D

AnderBiguri commented 7 months ago

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

Emvlt commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

Maybe its because of #509

Emvlt commented 6 months ago

This pull request accounts for: