zxzhaoeric / Semi-InstruSeg

14 stars 3 forks source link

images_and_flows isn't matched SDCNet #2

Open lee1k opened 3 years ago

lee1k commented 3 years ago

Hi, thanks for sharing your great work, there are somewrong when i try to implement this project: $ python train_mp.py Traceback (most recent call last): File "r/motion_learning/models/sdc_net2d.py", line 220, in forward flow_prediction = self.network_output(input_images, input_flows) RuntimeError: Given groups=1, weight of size 32 8 7 7, expected input[4, 11, 448, 448] to have 8 channels, but got 11 channels instead In network_output, length of input_images and input_flows are 3 and 1.

And when i use 2 gpus run $ python train_mc.py Traceback (most recent call last): File "/motion_learning/train_mc.py", line 295, in forward_only losses, outputs, targets = model(inputs_gpu) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, *kwargs) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 152, in forward outputs = self.parallel_apply(replicas, inputs, kwargs) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 162, in parallel_apply return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)]) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 85, in parallel_apply output.reraise() File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/_utils.py", line 385, in reraise raise self.exc_type(msg) RuntimeError: Caught RuntimeError in replica 1 on device 1. Original Traceback (most recent call last): File "/motion_learning/models/cycle_net.py", line 148, in forward g_I0_F_t_0 = self.back_warp(I0, F_t_0) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, **kwargs) File "/motion_learning/models/model_utils.py", line 128, in forward x = self.gridX.unsqueeze(0).expand_as(u).float() + u RuntimeError: expected device cuda:0 but got device cuda:1 My environment is python3.7, pytorch1.3.1 cuda10. How can i solve these problems? Thanks

zxzhaoeric commented 3 years ago

Hi,

Thanks for being interested in our work. Our code only support single GPU training. I suggest that you train the model with one GPU or extend a multi-GPU version for the warping function.

Best, Zixu

lee1k notifications@github.com 于2020年11月14日周六 上午8:45写道:

Hi, thanks for sharing your great work, there are somewrong when i try to implement this project: $ python train_mp.py Traceback (most recent call last): File "r/motion_learning/models/sdc_net2d.py", line 220, in forward flow_prediction = self.network_output(input_images, input_flows) RuntimeError: Given groups=1, weight of size 32 8 7 7, expected input[4, 11, 448, 448] to have 8 channels, but got 11 channels instead In network_output, length of input_images and input_flows are 3 and 1.

And when i use 2 gpus run $ python train_mc.py Traceback (most recent call last): File "/motion_learning/train_mc.py", line 295, in forward_only losses, outputs, targets = model(inputs_gpu) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, *kwargs) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 152, in forward outputs = self.parallel_apply(replicas, inputs, kwargs) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 162, in parallel_apply return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)]) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 85, in parallel_apply output.reraise() File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/_utils.py", line 385, in reraise raise self.exc_type(msg) RuntimeError: Caught RuntimeError in replica 1 on device 1. Original Traceback (most recent call last): File "/motion_learning/models/cycle_net.py", line 148, in forward g_I0_F_t_0 = self.back_warp(I0, F_t_0) File "/root/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, **kwargs) File "/motion_learning/models/model_utils.py", line 128, in forward x = self.gridX.unsqueeze(0).expand_as(u).float() + u RuntimeError: expected device cuda:0 but got device cuda:1 My environment is python3.7, pytorch1.3.1 cuda10. How can i solve these problems? Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zxzhaoeric/Semi-InstruSeg/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCVLYKQJECURCXNB63RK7DSP2CY5ANCNFSM4TVRXHVA .

-- Zixu Zhao PhD student Dept. of Computer Science and Engineering The Chinese University of Hong Kong Address: Room 1024, Ho Sin Hang Engineering Building, CUHK, Shatin, N.T., HK Phone: +852 53716818