HKUST-Aerial-Robotics / MVDepthNet

This repository provides PyTorch implementation for 3DV 2018 paper "MVDepthNet: real-time multiview depth estimation neural network"
GNU General Public License v3.0
309 stars 72 forks source link

conv2d error #24

Closed DejaYang closed 4 years ago

DejaYang commented 4 years ago

Hi, there was one error when I ran "python example.py", it is Traceback (most recent call last): File "example.py", line 62, in predict_depths = depthnet(left_image_cuda, right_image_cuda, KRKiUV_cuda_T, KT_cuda_T) File "/home/emg/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call result = self.forward(*input, kwargs) File "/home/emg/code_yj/stereo_code/MVDepthNet-master/depthNet_model.py", line 173, in forward conv1 = self.conv1(x) File "/home/emg/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call result = self.forward(*input, *kwargs) File "/home/emg/miniconda3/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/home/emg/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call result = self.forward(input, kwargs) File "/home/emg/miniconda3/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 343, in forward return self.conv2d_forward(input, self.weight) File "/home/emg/miniconda3/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 340, in conv2d_forward self.padding, self.dilation, self.groups) TypeError: conv2d(): argument 'padding' must be tuple of ints, but found element of type float at pos 1

Do you know how to solve this problem?

WANG-KX commented 4 years ago

Hi, run the code with python2.7. If you use python3, please change the code yourself. For example, change padding=(kernel_size - 1) / 2, into padding=int((kernel_size - 1) / 2),.