NVlabs / neuralrgbd

Neural RGB→D Sensing: Per-pixel depth and its uncertainty estimation from a monocular RGB video
Other
301 stars 41 forks source link

error: logical_not() #21

Open fisakhan opened 2 years ago

fisakhan commented 2 years ago

I get the following error by executing "sh run_demo.sh"

Parsing the arguments... Initnializing the KV-Net bn_running_avg = 0 RefineNet_UNet2D: init conv2d RefineNet_UNet2D: init conv2d init transposed 2d RefineNet_UNet2D: init conv2d RefineNet_UNet2D: init conv2d init transposed 2d RefineNet_UNet2D: init conv2d RefineNet_UNet2D: init conv2d RefineNet_UNet2D: init conv2d KV-Net initialization: with R-net: True refinement name: DPV loading KV_net at ./saved_models/kvnet_scannet.tar Done Getting the paths for traj_0 Done Traceback (most recent call last): File "test_KVNet.py", line 255, in main() File "test_KVNet.py", line 185, in main dat_array = [ dataset[idx] for idx in range(t_win_r 2 + 1) ]
File "test_KVNet.py", line 185, in dat_array = [ dataset[idx] for idx in range(t_win_r
2 + 1) ]
File "/home/Projects/torch/neuralrgbd/code/mdataloader/scanNet.py", line 400, in getitem dmap_mask = 1 - (proc_totensor(dmap_mask) > 0 ) File "/home/.virtualenvs/torch/lib/python3.6/site-packages/torch/_tensor.py", line 544, in rsub return _C._VariableFunctions.rsub(self, other) RuntimeError: Subtraction, the - operator, with a bool tensor is not supported. If you are trying to invert a mask, use the ~ or logical_not() operator instead.

sushlokshah commented 2 years ago

replace '1-(proc_totensor(dmap_mask) > 0 )' and '1-( proc_totensor( dmap_mask_imgsize ) >0)' from line 400 and 401 of scanNet.py with ~(proc_totensor(dmap_mask) > 0 ) and ~( proc_totensor( dmap_mask_imgsize ) >0)