Coder Social home page Coder Social logo

RuntimeError: The size of tensor a (75) must match the size of tensor b (76) at non-singleton dimension 3 about boostingmonoculardepth HOT 4 CLOSED

compphoto avatar compphoto commented on August 16, 2024
RuntimeError: The size of tensor a (75) must match the size of tensor b (76) at non-singleton dimension 3

from boostingmonoculardepth.

Comments (4)

sebastian-dille avatar sebastian-dille commented on August 16, 2024 1

Hi @bhanuteja2001,

it looks like the issue is coming from
GPU_threshold = 1200

The network requires a multiple of 32 as input resolution. Try setting the threshold to 1184 or 1216.

from boostingmonoculardepth.

bhanuteja2001 avatar bhanuteja2001 commented on August 16, 2024

device: cuda
Namespace(Final=True, R0=False, R20=False, colorize_results=False, data_dir='G:\Fiver\BoostingMonocularDepth\inputs', depthNet=2, max_res=inf, net_receptive_field_size=None, output_dir='G:\Fiver\BoostingMonocularDepth\output\', output_resolution=1, pix2pixsize=1024, savepatchs=0, savewholeest=0)
----------------- Options ---------------
Final: True [default: False]
R0: False
R20: False
aspect_ratio: 1.0
batch_size: 1
checkpoints_dir: ./pix2pix/checkpoints
colorize_results: False
crop_size: 672
data_dir: G:\Fiver\BoostingMonocularDepth\inputs [default: None]
dataroot: None
dataset_mode: depthmerge
depthNet: 2 [default: None]
direction: AtoB
display_winsize: 256
epoch: latest
eval: False
generatevideo: None
gpu_ids: 0
init_gain: 0.02
init_type: normal
input_nc: 2
isTrain: False [default: None]
load_iter: 0 [default: 0]
load_size: 672
max_dataset_size: 10000
max_res: inf
model: pix2pix4depth
n_layers_D: 3
name: void
ndf: 64
netD: basic
netG: unet_1024
net_receptive_field_size: None
ngf: 64
no_dropout: False
no_flip: False
norm: none
num_test: 50
num_threads: 4
output_dir: G:\Fiver\BoostingMonocularDepth\output\ [default: None]
output_nc: 1
output_resolution: None
phase: test
pix2pixsize: None
preprocess: resize_and_crop
savecrops: None
savewholeest: None
serial_batches: False
suffix:
verbose: False
----------------- End -------------------
initialize network with normal
loading the model from ./pix2pix/checkpoints/mergemodel\latest_net_G.pth
start processing
processing image 0 : sample1
wholeImage being processed in : 1792
DEBUG| GPU THRESHOLD REACHED 1792 ---> 1200
Traceback (most recent call last):
File "run.py", line 580, in
run(dataset_, option_)
File "run.py", line 125, in run
whole_estimate = doubleestimate(img, option.net_receptive_field_size, whole_image_optimal_size,
File "run.py", line 394, in doubleestimate
estimate2 = singleestimate(img, size2, net_type)
File "run.py", line 422, in singleestimate
return estimateleres(img, msize)
File "run.py", line 520, in estimateleres
prediction = leresmodel.inference(img_torch)
File "G:\Fiver\BoostingMonocularDepth\lib\multi_depth_model_woauxi.py", line 18, in inference
depth = self.depth_model(input)
File "C:\Users\Bhanu\anaconda3\envs\boost\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "G:\Fiver\BoostingMonocularDepth\lib\multi_depth_model_woauxi.py", line 32, in forward
out_logit = self.decoder_modules(lateral_out)
File "C:\Users\Bhanu\anaconda3\envs\boost\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "G:\Fiver\BoostingMonocularDepth\lib\network_auxi.py", line 57, in forward
x_8 = self.ffm2(features[2], x_16) # 1/8
File "C:\Users\Bhanu\anaconda3\envs\boost\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "G:\Fiver\BoostingMonocularDepth\lib\network_auxi.py", line 209, in forward
x = x + high_x
RuntimeError: The size of tensor a (75) must match the size of tensor b (76) at non-singleton dimension 3

from boostingmonoculardepth.

bhanuteja2001 avatar bhanuteja2001 commented on August 16, 2024

I have changed the following

whole_size_threshold = 2000 # R_max from the paper
GPU_threshold = 1200 # Limit for the GPU (NVIDIA RTX 2080), can be adjusted

from boostingmonoculardepth.

bhanuteja2001 avatar bhanuteja2001 commented on August 16, 2024

The code works fine with MiDaS.
The above error occured while using LeReS

from boostingmonoculardepth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.