YaoleiQi / DSCNet

Pytorch Implement of Dynamic Snake Convolution (ICCV2023)
418 stars 37 forks source link

batch_size不等于1时,程序报错 #16

Open LZLlzx opened 1 year ago

LZLlzx commented 1 year ago

Traceback (most recent call last): File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S0_Main.py", line 229, in Process(args) File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S0_Main.py", line 63, in Process Train(args) File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S3_Train_Process.py", line 503, in Train Train_net(net, args) File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S3_Train_Process.py", line 129, in Train_net loss = train_epoch( File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S3_Train_Process.py", line 50, in train_epoch output = model(image) File "C:\Users\Administrator.conda\envs\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S3_DSCNet.py", line 104, in forward x_0x_0 = self.conv0z(x) File "C:\Users\Administrator.conda\envs\py39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(args, **kwargs) File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S3_DSConv.py", line 50, in forward deformed_feature = dcn.deform_conv(f, offset, self.if_offset) File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S3_DSConv.py", line 415, in deform_conv z, y, x = self._coordinate_map_3D(offset, if_offset) File "d:\projects\medit_seg\DSCNet_3D_opensource\Code\Kipa\DSCNet\S3_DSConv.py", line 279, in _coordinate_map_3D z_new = z_new.reshape([self.num_batch, self.num_points, 1, 1, self.depth, self.width, self.height]) RuntimeError: shape '[2, 3, 1, 1, 128, 96, 96]' is invalid for input of size 3538944

YaoleiQi commented 1 year ago

Sorry, the version you downloaded should be the first uploaded version, this problem we solved in the second version ~ thank you for your attention!

LZLlzx commented 1 year ago

感谢回复,第二个版本是什么时候更新啊

YaoleiQi commented 1 year ago

您好,目前的版本已经可以了

LZLlzx commented 1 year ago

感谢回复,以下两处代码麻烦确认一下是否正确 1,s3_dsconv

s3_dsconv 2,s3_dscnet s3_dscnet

YaoleiQi commented 1 year ago

非常感谢您指出问题!这是我们重构的版本,可能存在部分失误,现已重构!