Closed mit-mit-pg closed 2 weeks ago
It looks like your variable x is float64. Make sure you do this: if forward_project: x = rng.random(size=(1,256,256),dtype=np.float32) # size of the image else: x = rng.random(size=(180,1,256),dtype=np.float32) # size of the projection
Regardless, I get an error as well. @hkimdavis could you look into this?
@mit-mit-pg could you pull the main branch again to see if it works?
@kylechampley Thanks for checking my comment! That's my mistake, the variable should be float32.
@hkimdavis Due to personal reasons, it will be a little while before I can confirm, but I greatly appreciate the quick update. I will comment as soon as I get results.
I'm really sorry for the late reply. Thanks to your update, the problem seems to be solved!! In my environment, the backpropagation went fine.
I think this issue can be closed now!
Glad it worked!
Hi, thank you for the amazing work! I really enjoy to use it. I have a question about the differentiability of Backprojection.
When I tried to calculate the gradient after BackProjection,
RuntimeError: One of the differentiated Tensors appears to not have been used in the graph.
has occured.Below is a simple script to reproduce the issue. If “forward_project ” is set to True, there is no problem, but if it is set to False (=using BackProjcection), an error occurs in my environment. (I am aware that this code, which calculates the loss of the projected image itself, is pointless, but I put it because I thought it would make it easy to understand the problem.)
At first I thought that the computational graph was not generated correctly through backprojection function. Or am I using the library incorrectly?
I would really appreciate it if you could let me know. Thanks in advance!