-
Notifications
You must be signed in to change notification settings - Fork 28
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
Nan of smooothing_loss and large number of cross_correlation_loss #2
Comments
Hey @elfprincess3, can you please give me more information about the problem? |
Hi you should smooth on deformation field , not warp image. |
And i think the smooth loss is wrong implementation |
So, 'y' in vox_morph_loss is the deformation field? how about y_true? |
No. y is warped/moved image. y true is fixed image. I think this project is wrong to reproduce result. You can check tf version. Smooth must be in displacement vector |
Hey @John1231983, yeah you are right that y is the warped image and y_true is the fixed image. And thanks for pointing out that I made a mistake in implementing smooth loss. It's bad from my side and I apologise for that. I'll correct it as soon as possible. |
@elfprincess3, It's bad choice of name and I'll change it in my next commit. I apologise for the trouble. |
Hey everyone, if you found another place where I may have made a mistake, kindly share it. I'll be grateful for your feedback and improve it as soon as possible. |
@Hsankesara : This is unit test for smooth loss in 3D. Hope it help https://colab.research.google.com/drive/1GJl1zWxTPF4KyHwiqK8elraz0xqb855R For spatial transformation layer, could we simple use grid_sample() function in pytorch, instead of write it. Could you try it? For NCC loss, you implemented correct but when test on tf, I found a big gap betwen tf and pytorch. I opened the discussion in https://discuss.pytorch.org/t/big-error-between-tensorflow-code-and-reproduce-in-pytorch/54635/2 If you find the solution why it happen, let me know? |
Thanks, @John1231983, I'll definitely update the code accordingly. Thanks for your help. |
@Hsankesara, that's all right, thanks! |
@ John1231983, thanks for your answer. I will check the tf version. I want to find a suitable loss for image registration, but it seems cross correlation have some problems in pytorch. |
Ok. Now both loss are close to tensorflow version. You csn use it |
Thanks, @John1231983, for improving it. I'll add them as soon as possible. |
Hi John. May I ask if there is any update for this version? |
HI, I wraped the deformation field, but got a negative loss, did you solved it or run successfully in 2d/3d image without abnormal results? |
Hello,
I used your loss part in my registration task. But I got a Nan of smooothing_loss and large number of cross_correlation_loss like 3.3388e+10. I wonder why this happend and any solutions?
Thanks
The text was updated successfully, but these errors were encountered: