zju3dv / NeuralRecon

Code for "NeuralRecon: Real-Time Coherent 3D Reconstruction from Monocular Video", CVPR 2021 oral
https://zju3dv.github.io/neuralrecon/
Apache License 2.0
2.07k stars 299 forks source link

Errors in Forward Pass #19

Closed ericdqian closed 3 years ago

ericdqian commented 3 years ago

I'm running into an error during the forward pass in both training and the demo. This occurs when neighbor_map is one dimensional in the torchsparse function. Was this ever encountered during development?

Traceback (most recent call last): File "main.py", line 308, in train() File "main.py", line 212, in train loss, scalar_outputs = train_sample(sample) File "main.py", line 288, in train_sample outputs, loss_dict = model(sample) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, kwargs) File "/data/vision/billf/scratch/ericqian/neural-render/code/NeuralRecon/models/neuralrecon.py", line 82, in forward outputs, loss_dict = self.neucon_net(features, inputs, outputs) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, *kwargs) File "/data/vision/billf/scratch/ericqian/neural-render/code/NeuralRecon/models/neucon_network.py", line 157, in forward feat = self.sp_convsi File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(input, kwargs) File "/data/vision/billf/scratch/ericqian/neural-render/code/NeuralRecon/models/modules.py", line 154, in forward x1 = self.stage1(x1) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, kwargs) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/container.py", line 117, in forward input = module(input) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, *kwargs) File "/data/vision/billf/scratch/ericqian/neural-render/code/NeuralRecon/models/modules.py", line 24, in forward out = self.net(x) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(input, kwargs) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/container.py", line 117, in forward input = module(input) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torchsparse/nn/modules/conv.py", line 63, in forward transpose=self.t) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torchsparse/nn/functional/sparseconv.py", line 151, in conv3d idx_query = list(convert_neighbor_map_gpu(idx_query)) File "/data/vision/billf/intrinsic/neural-render/ericqian/software/miniconda3/envs/necon/lib/python3.7/site-packages/torchsparse/nn/functional/convert_neighbor_map.py", line 10, in forward idx_batch, idx_point = torch.where(neighbor_map != -1) ValueError: not enough values to unpack (expected 2, got 1) Segmentation fault

JiamingSuen commented 3 years ago

No, we haven't encountered this issue during the development. This could be an environment configuration problem. You may check if torchsparse is correctly installed and compilation by the end of the installation is successful.

ericdqian commented 3 years ago

Thank you for the quick response! I believe my torchsparse is installed properly since I can run their examples. Could you share what version was used during development?

JiamingSuen commented 3 years ago

This is the complete version information of my environment.

name: neucon
channels:
  - conda-forge
  - pytorch
dependencies:
  - _libgcc_mutex=0.1=main
  - backcall=0.2.0=pyhd3eb1b0_0
  - blas=1.0=mkl
  - ca-certificates=2021.4.13=h06a4308_1
  - certifi=2020.12.5=py37h06a4308_0
  - cudatoolkit=10.2.89=hfd86e86_1
  - freetype=2.10.4=h5ab3b9f_0
  - intel-openmp=2021.2.0=h06a4308_610
  - ipython=7.22.0=py37hb070fc8_0
  - ipython_genutils=0.2.0=pyhd3eb1b0_1
  - jedi=0.17.0=py37_0
  - jpeg=9b=h024ee3a_2
  - lcms2=2.12=h3be6417_0
  - ld_impl_linux-64=2.33.1=h53a641e_7
  - libffi=3.3=he6710b0_2
  - libgcc-ng=9.1.0=hdf63c60_0
  - libllvm10=10.0.1=hbcb73fb_5
  - libpng=1.6.37=hbc83047_0
  - libstdcxx-ng=9.1.0=hdf63c60_0
  - libtiff=4.1.0=h2733197_1
  - llvmlite=0.36.0=py37h612dafd_4
  - lz4-c=1.9.3=h2531618_0
  - mkl=2021.2.0=h06a4308_296
  - mkl-service=2.3.0=py37h27cfd23_1
  - mkl_fft=1.3.0=py37h42c9631_2
  - mkl_random=1.2.1=py37ha9443f7_2
  - ncurses=6.2=he6710b0_1
  - ninja=1.10.2=hff7bd54_1
  - numba=0.53.1=py37ha9443f7_0
  - numpy=1.20.1=py37h93e21f0_0
  - numpy-base=1.20.1=py37h7d8b39e_0
  - olefile=0.46=py37_0
  - openssl=1.1.1k=h27cfd23_0
  - parso=0.8.2=pyhd3eb1b0_0
  - pexpect=4.8.0=pyhd3eb1b0_3
  - pickleshare=0.7.5=pyhd3eb1b0_1003
  - pillow=8.2.0=py37he98fc37_0
  - pip=21.0.1=py37h06a4308_0
  - prompt-toolkit=3.0.17=pyh06a4308_0
  - ptyprocess=0.7.0=pyhd3eb1b0_2
  - pygments=2.8.1=pyhd3eb1b0_0
  - python=3.7.9=h7579374_0
  - pytorch=1.6.0=py3.7_cuda10.2.89_cudnn7.6.5_0
  - readline=8.1=h27cfd23_0
  - setuptools=52.0.0=py37h06a4308_0
  - six=1.15.0=py37h06a4308_0
  - sparsehash=2.0.3=hf484d3e_1000
  - sqlite=3.35.4=hdfb4753_0
  - tbb=2020.3=hfd86e86_0
  - tk=8.6.10=hbc83047_0
  - torchvision=0.7.0=py37_cu102
  - traitlets=5.0.5=pyhd3eb1b0_0
  - wcwidth=0.2.5=py_0
  - wheel=0.36.2=pyhd3eb1b0_0
  - xz=5.2.5=h7b6447c_0
  - zlib=1.2.11=h7b6447c_3
  - zstd=1.4.9=haebb681_0
  - pip:
    - addict==2.4.0
    - aiohttp==3.7.4.post0
    - aiohttp-cors==0.7.0
    - aioredis==1.3.1
    - appdirs==1.4.4
    - argon2-cffi==20.1.0
    - async-generator==1.10
    - async-timeout==3.0.1
    - attrs==20.3.0
    - bleach==3.3.0
    - blessings==1.7
    - cached-property==1.5.2
    - cachetools==4.2.2
    - cffi==1.14.5
    - chardet==4.0.0
    - colorama==0.4.4
    - cycler==0.10.0
    - decorator==4.4.2
    - defusedxml==0.7.1
    - entrypoints==0.3
    - filelock==3.0.12
    - freetype-py==2.2.0
    - gdown==3.13.0
    - google-api-core==1.26.3
    - google-auth==1.30.0
    - googleapis-common-protos==1.53.0
    - gpustat==0.6.0
    - grpcio==1.37.1
    - h5py==3.2.1
    - hiredis==2.0.0
    - humanize==3.5.0
    - idna==2.10
    - imageio==2.9.0
    - importlib-metadata==4.0.1
    - ipykernel==5.5.4
    - ipywidgets==7.6.3
    - jinja2==2.11.3
    - jsonschema==3.2.0
    - jupyter-client==6.2.0
    - jupyter-core==4.7.1
    - jupyterlab-pygments==0.1.2
    - jupyterlab-widgets==1.0.0
    - kiwisolver==1.3.1
    - loguru==0.5.3
    - mako==1.1.4
    - markupsafe==1.1.1
    - matplotlib==3.4.1
    - mistune==0.8.4
    - msgpack==1.0.2
    - multidict==5.1.0
    - nbclient==0.5.3
    - nbconvert==6.0.7
    - nbformat==5.1.3
    - nest-asyncio==1.5.1
    - networkx==2.5.1
    - notebook==6.3.0
    - nvidia-ml-py3==7.352.0
    - open3d==0.12.0
    - opencensus==0.7.12
    - opencensus-context==0.1.2
    - opencv-python==4.5.1.48
    - packaging==20.9
    - pandas==1.2.4
    - pandocfilters==1.4.3
    - plyfile==0.7.4
    - prometheus-client==0.10.1
    - protobuf==3.15.8
    - psutil==5.8.0
    - py-spy==0.3.5
    - pyasn1==0.4.8
    - pyasn1-modules==0.2.8
    - pycparser==2.20
    - pycuda==2021.1
    - pyglet==1.5.16
    - pyopengl==3.1.0
    - pyparsing==2.4.7
    - pyrender==0.1.45
    - pyrsistent==0.17.3
    - pysocks==1.7.1
    - python-dateutil==2.8.1
    - pytools==2021.2.6
    - pytz==2021.1
    - pywavelets==1.1.1
    - pyyaml==5.4.1
    - pyzmq==22.0.3
    - ray==1.3.0
    - redis==3.5.3
    - requests==2.25.1
    - rsa==4.7.2
    - scikit-image==0.18.1
    - scikit-learn==0.24.2
    - scipy==1.6.3
    - send2trash==1.5.0
    - sklearn==0.0
    - tensorboardx==2.2
    - terminado==0.9.4
    - testpath==0.4.4
    - threadpoolctl==2.1.0
    - tifffile==2021.4.8
    - torchsparse==1.2.0
    - tornado==6.1
    - tqdm==4.60.0
    - transforms3d==0.3.1
    - trimesh==3.9.19
    - typing-extensions==3.7.4.3
    - urllib3==1.26.4
    - webencodings==0.5.1
    - widgetsnbextension==3.5.1
    - yacs==0.1.8
    - yarl==1.6.3
    - zipp==3.4.1
prefix: /home/sunjiaming/miniconda3/envs/neucon
ericdqian commented 3 years ago

Thank you for this! I'm still running into issues - I'll further investigate torchsparse