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

Hello, in the pytorch file in MultiResUNet3D.py, I found some traces unique to the tensorflow version. For example, "padding = 'same'" in line 19. Is there a full pytorch version of the code? #29

Open
lxy51 opened this issue Apr 7, 2024 · 3 comments

Comments

@lxy51
Copy link

lxy51 commented Apr 7, 2024

Hello, in the pytorch file in MultiResUNet3D.py, I found some traces unique to the tensorflow version. For example, "padding = 'same'" in line 19. Is there a full pytorch version of the code?

@nibtehaz
Copy link
Owner

nibtehaz commented Apr 7, 2024

Hi @lxy51 , thank you for your interest in our project.

Thank you for bringing this to my attention. I think padding='same' is applicable for pytorch as you can see from the doc (https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html)

padding controls the amount of padding applied to the input. It can be either a string {‘valid’, ‘same’} or an int / a tuple of ints giving the amount of implicit padding applied on both sides.

Are you facing any issues with this? Please let me know what error you are facing and I would be happy to help.

@lxy51
Copy link
Author

lxy51 commented Apr 7, 2024

Traceback (most recent call last):
File "/root/data1/SeqRegNet8/train_one_shot.py", line 347, in
main(args)
File "/root/data1/SeqRegNet8/train_one_shot.py", line 73, in main
simi_loss, smooth_loss, jdet_loss, cyclic_loss, total_loss = regnet.update(input_image)
File "/root/data1/SeqRegNet8/model.py", line 114, in update
return self.update_un_compose(input_image)
File "/root/data1/SeqRegNet8/model.py", line 120, in update_un_compose
res = self.forward(input_image)
File "/root/data1/SeqRegNet8/model.py", line 36, in forward
return self.forward_cdf(input_image, sample)
File "/root/data1/SeqRegNet8/model.py", line 50, in forward_cdf
scaled_disp_t2i = self.unet(scaled_image)
File "/root/data1/lxy/envs/python37Se/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/data1/SeqRegNet8/MultiResUNet3D.py", line 165, in forward
x_multires1 = self.multiresblock1(x1)
File "/root/data1/lxy/envs/python37Se/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/data1/SeqRegNet8/MultiResUNet3D.py", line 50, in forward
shrtct = self.shortcut(x)
File "/root/data1/lxy/envs/python37Se/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/data1/SeqRegNet8/MultiResUNet3D.py", line 15, in forward
x = self.conv1(x)
File "/root/data1/lxy/envs/python37Se/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/data1/lxy/envs/python37Se/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 521, in forward
self.padding, self.dilation, self.groups)
File "/root/data1/lxy/envs/python37Se/lib/python3.7/site-packages/apex/amp/wrap.py", line 28, in wrapper
return orig_fn(*new_args, **kwargs)
TypeError: conv3d(): argument 'padding' (position 5) must be tuple of ints, not str

进程已结束,退出代码为 1

When I run it, it shows the above error.

@lxy51
Copy link
Author

lxy51 commented Apr 7, 2024

First of all, thank you for your great creation. Because I am a novice in this field, I don't know much about these, I am really sorry.
I am very interested in this research project.
I wonder if I can add your contact information to facilitate communication with you.
I come from China, and we mainly use wechat. May I ask what software do you usually use for daily communication? Or is it convenient to leave your email address for communication?

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

No branches or pull requests

2 participants