MVSNet_pytorch icon indicating copy to clipboard operation
MVSNet_pytorch copied to clipboard

RuntimeError: The size of tensor a (31) must match the size of tensor b (32) at non-singleton dimension 3

Open isshenye opened this issue 3 years ago • 3 comments

`Traceback (most recent call last): File "eval.py", line 307, in save_depth()

File "eval.py", line 118, in save_depth outputs = model(sample_cuda["imgs"], sample_cuda["proj_matrices"], sample_cuda["depth_values"])

File "/home/amax/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs)

File "/home/amax/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 143, in forward outputs = self.parallel_apply(replicas, inputs, kwargs)

File "/home/amax/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 153, in parallel_apply return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])

File "/home/amax/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 83, in parallel_apply raise output

File "/home/amax/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 59, in _worker output = module(*input, **kwargs)

File "/home/amax/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs)

File "/home/amax/shenye/colmapTest1/MVSNet_pytorch-master/models/mvsnet.py", line 132, in forward cost_reg = self.cost_regularization(volume_variance)

File "/home/amax/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs)

File "/home/amax/shenye/colmapTest1/MVSNet_pytorch-master/models/mvsnet.py", line 66, in forward x = conv4 + self.conv7(x)

RuntimeError: The size of tensor a (31) must match the size of tensor b (32) at non-singleton dimension 3`

Hello,how do you deal this problem?

isshenye avatar Apr 27 '21 08:04 isshenye

we met the same problem, is it solved now ?

hanamizukigakki avatar Jun 10 '21 03:06 hanamizukigakki

we met the same problem, is it solved now ?

没,难顶,可能是我自己拍的图片太大了,我用数据集里的图片就可以跑,自己拍的图片后来用VisMVSNet跑成功了

isshenye avatar Jun 10 '21 06:06 isshenye

The height and width of the original image should be divisible by 32 because the depth map is 1/4 size and the 3D cost network performs "stride=2" three times.

MiZhenxing avatar Jun 13 '21 08:06 MiZhenxing