Giter VIP home page Giter VIP logo

chengzhag / implicit3dunderstanding Goto Github PK

View Code? Open in Web Editor NEW
198.0 6.0 34.0 60.68 MB

Official PyTorch code of Holistic 3D Scene Understanding from a Single Image with Implicit Representation (CVPR 2021). Also includes a PyTorch implementation of the decoder of LDIF (from 3D Shape Representation with Local Deep Implicit Functions).

Home Page: https://chengzhag.github.io/publication/im3d/

License: MIT License

Python 100.00%
ldif coop scene-graph sgcn deep-learning pytorch

implicit3dunderstanding's Introduction

Holistic 3D Scene Understanding from a Single Image with Implicit Representation

Cheng Zhang*, Zhaopeng Cui*, Yinda Zhang*, Shuaicheng Liu, Bing Zeng, Marc Pollefeys

img.jpg 3dbbox.png recon.png
img.jpg 3dbbox.png recon.png
img.jpg 3dbbox.png recon.png

pipeline

Introduction

This repo contains training, testing, evaluation, visualization code of our CVPR 2021 paper. Specially, the repo contains our PyTorch implementation of the decoder of LDIF, which can be extracted and used in other projects.

Install

Please make sure to install CUDA NVCC on your system first. then run the following:

sudo apt install xvfb ninja-build freeglut3-dev libglew-dev meshlab
conda env create -f environment.yml
conda activate Im3D
python project.py build

When running python project.py build, the script will run external/build_gaps.sh which requires password for sudo privilege for apt-get install. Please make sure you are running with a user with sudo privilege. If not, please reach your administrator for installation of these libraries and comment out the corresponding lines then run python project.py build.

Demo

  1. Download the pretrained checkpoint and unzip it into out/total3d/20110611514267/

  2. Change current directory to Implicit3DUnderstanding/ and run the demo, which will generate 3D detection result and rendered scene mesh to demo/output/1/

    CUDA_VISIBLE_DEVICES=0 python main.py out/total3d/20110611514267/out_config.yaml --mode demo --demo_path demo/inputs/1
    
  3. In case you want to run it off screen (for example, with SSH)

    CUDA_VISIBLE_DEVICES=0 xvfb-run -a -s "-screen 0 800x600x24" python main.py out/total3d/20110611514267/out_config.yaml --mode demo --demo_path demo/inputs/1
    
  4. If you want to run it interactively, change the last line of demo.py

    scene_box.draw3D(if_save=True, save_path = '%s/recon.png' % (save_path))
    

    to

    scene_box.draw3D(if_save=False, save_path = '%s/recon.png' % (save_path))
    

Data preparation

We follow Total3DUnderstanding to use SUN-RGBD to train our Scene Graph Convolutional Network (SGCN), and use Pix3D to train our Local Implicit Embedding Network (LIEN) with Local Deep Implicit Functions (LDIF) decoder.

Preprocess SUN-RGBD data

Please follow Total3DUnderstanding to directly download the processed train/test data.

In case you prefer processing by yourself or want to evaluate 3D detection with our code (To ultilize the evaluation code of Coop, we modified the data processing code of Total3DUnderstanding to save parameters for transforming the coordinate system from Total3D back to Coop), please follow these steps:

  1. Follow Total3DUnderstanding to download the raw data.

  2. According to issue #6 of Total3DUnderstanding, there are a few typos in json files of SUNRGBD dataset, which is mostly solved by the json loader. However, one typo still needs to be fixed by hand. Please find {"name":""propulsion"tool"} in data/sunrgbd/Dataset/SUNRGBD/kv2/kinect2data/002922_2014-06-26_15-43-16_094959634447_rgbf000089-resize/annotation2Dfinal/index.json and remove ""propulsion.

  3. Process the data by

    python -m utils.generate_data
    

Preprocess Pix3D data

We use a different data process pipeline with Total3DUnderstanding. Please follow these steps to generate the train/test data:

  1. Download the Pix3D dataset to data/pix3d/metadata

  2. Run below to generate the train/test data into 'data/pix3d/ldif'

    python utils/preprocess_pix3d4ldif.py
    

Training and Testing

We use wandb for logging and visualization. You can register a wandb account and login before training by wandb login. In case you don't need to visualize the training process, you can put WANDB_MODE=dryrun before the commands bellow.

Thanks to the well-structured code of Total3DUnderstanding, we use the same method to manage parameters of each experiment with configuration files (configs/****.yaml). We first follow Total3DUnderstanding to pretrain each individual module, then jointly finetune the full model with additional physical violation loss.

Pretraining

We use the pretrained checkpoint of Total3DUnderstanding to load weights for ODN. Please download and rename the checkpoint to out/pretrained_models/total3d/model_best.pth. Other modules can be trained then tested with the following steps:

  1. Train LEN by:

    python main.py configs/layout_estimation.yaml
    

    The pretrained checkpoint can be found at out/layout_estimation/[start_time]/model_best.pth

  2. Train LIEN + LDIF by:

    python main.py configs/ldif.yaml
    

    The pretrained checkpoint can be found at out/ldif/[start_time]/model_best.pth (alternatively, you can download the pretrained model here, and unzip it into out/ldif/20101613380518/)

    The training process is followed with a quick test without ICP and Chamfer distance evaluated. In case you want to align mesh and evaluate the Chamfer distance during testing:

    python main.py configs/ldif.yaml --mode train
    

    The generated object meshes can be found at out/ldif/[start_time]/visualization

  3. Replace the checkpoint directories of LEN and LIEN in configs/total3d_ldif_gcnn.yaml with the checkpoints trained above, then train SGCN by:

    python main.py configs/total3d_ldif_gcnn.yaml
    

    The pretrained checkpoint can be found at out/total3d/[start_time]/model_best.pth

Joint finetune

  1. Replace the checkpoint directory in configs/total3d_ldif_gcnn_joint.yaml with the one trained in the last step above, then train the full model by:

    python main.py configs/total3d_ldif_gcnn_joint.yaml
    

    The trained model can be found at out/total3d/[start_time]/model_best.pth

  2. The training process is followed with a quick test without scene mesh generated. In case you want to generate the scene mesh during testing (which will cost a day on 1080ti due to the unoptimized interface of LDIF CUDA kernel):

    python main.py configs/total3d_ldif_gcnn_joint.yaml --mode train
    

    The testing resaults can be found at out/total3d/[start_time]/visualization

Testing

  1. The training process above already include a testing process. In case you want to test LIEN+LDIF or full model by yourself:

    python main.py out/[ldif/total3d]/[start_time]/out_config.yaml --mode test
    

    The results will be saved to out/total3d/[start_time]/visualization and the evaluation metrics will be logged to wandb as run summary.

  2. Evaluate 3D object detection with our modified matlab script from Coop:

    external/cooperative_scene_parsing/evaluation/detections/script_eval_detection.m
    

    Before running the script, please specify the following parameters:

    SUNRGBD_path = 'path/to/SUNRGBD';
    result_path = 'path/to/experiment/results/visualization';
    
  3. Visualize the i-th 3D scene interacively by

    python utils/visualize.py --result_path out/total3d/[start_time]/visualization --sequence_id [i]
    

    or save the 3D detection result and rendered scene mesh by

    python utils/visualize.py --result_path out/total3d/[start_time]/visualization --sequence_id [i] --save_path []
    

    In case you do not have a screen:

    python utils/visualize.py --result_path out/total3d/[start_time]/visualization --sequence_id [i] --save_path [] --offscreen
    

    If nothing goes wrong, you should get results like:

    camera view 3D bbox scene reconstruction

  4. Visualize the detection results from a third person view with our modified matlab script from Coop:

    external/cooperative_scene_parsing/evaluation/vis/show_result.m
    

    Before running the script, please specify the following parameters:

    SUNRGBD_path = 'path/to/SUNRGBD';
    save_root = 'path/to/save/the/detection/results';
    paths = {
        {'path/to/save/detection/results', 'path/to/experiment/results/visualization'}, ...
        {'path/to/save/gt/boundingbox/results'}
    };
    vis_pc = false; % or true, if you want to show cloud point ground truth
    views3d = {'oblique', 'top'}; % choose prefered view
    dosave = true; % or false, please place breakpoints to interactively view the results.
    

    If nothing goes wrong, you should get results like:

    oblique view 3D bbox

About the testing speed

Thanks to the simplicity of LIEN+LDIF, the pretrain takes only about 8 hours on a 1080Ti. However, although we used the CUDA kernel of LDIF to optimize the speed, the file-based interface of the kernel still bottlenecked the mesh reconstruction. This is the main reason why our method takes much more time in object and scene mesh reconstruction. If you want speed over mesh quality, please lower the parameter data.marching_cube_resolution in the configuration file.

Citation

If you find our work and code helpful, please consider cite:

@InProceedings{Zhang_2021_CVPR,
    author    = {Zhang, Cheng and Cui, Zhaopeng and Zhang, Yinda and Zeng, Bing and Pollefeys, Marc and Liu, Shuaicheng},
    title     = {Holistic 3D Scene Understanding From a Single Image With Implicit Representation},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {8833-8842}
}

We thank the following great works:

  • Total3DUnderstanding for their well-structured code. We construct our network based on their well-structured code.
  • Coop for their dataset. We used their processed dataset with 2D detector prediction.
  • LDIF for their novel representation method. We ported their LDIF decoder from Tensorflow to PyTorch.
  • Graph R-CNN for their scene graph design. We adopted their GCN implemention to construct our SGCN.
  • Occupancy Networks for their modified version of mesh-fusion pipeline.

If you find them helpful, please cite:

@InProceedings{Nie_2020_CVPR,
author = {Nie, Yinyu and Han, Xiaoguang and Guo, Shihui and Zheng, Yujian and Chang, Jian and Zhang, Jian Jun},
title = {Total3DUnderstanding: Joint Layout, Object Pose and Mesh Reconstruction for Indoor Scenes From a Single Image},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}
}
@inproceedings{huang2018cooperative,
  title={Cooperative Holistic Scene Understanding: Unifying 3D Object, Layout, and Camera Pose Estimation},
  author={Huang, Siyuan and Qi, Siyuan and Xiao, Yinxue and Zhu, Yixin and Wu, Ying Nian and Zhu, Song-Chun},
  booktitle={Advances in Neural Information Processing Systems},
  pages={206--217},
  year={2018}
}	
@inproceedings{genova2020local,
    title={Local Deep Implicit Functions for 3D Shape},
    author={Genova, Kyle and Cole, Forrester and Sud, Avneesh and Sarna, Aaron and Funkhouser, Thomas},
    booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
    pages={4857--4866},
    year={2020}
}
@inproceedings{yang2018graph,
    title={Graph r-cnn for scene graph generation},
    author={Yang, Jianwei and Lu, Jiasen and Lee, Stefan and Batra, Dhruv and Parikh, Devi},
    booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
    pages={670--685},
    year={2018}
}
@inproceedings{mescheder2019occupancy,
  title={Occupancy networks: Learning 3d reconstruction in function space},
  author={Mescheder, Lars and Oechsle, Michael and Niemeyer, Michael and Nowozin, Sebastian and Geiger, Andreas},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={4460--4470},
  year={2019}
}

implicit3dunderstanding's People

Contributors

chengzhag avatar maruitx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

implicit3dunderstanding's Issues

Errors about the pyTorchChamferDistance

Thanks for your great work! When I run the command CUDA_VISIBLE_DEVICES=0 python main.py out/total3d/20110611514267/out_config.yaml --mode demo --demo_path demo/inputs/1 ,I get the following error:
①Traceback (most recent call last):
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 949, in _build_extension_module
check=True)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 8, in
import train, test,demo
File "/home/data4t/wyf/Implicit3DUnderstanding/train.py", line 4, in
from models.optimizers import load_optimizer, load_scheduler
File "/home/data4t/wyf/Implicit3DUnderstanding/models/init.py", line 1, in
from . import total3d, mgnet, ldif
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/init.py", line 1, in
from . import modules, training, config, dataloader
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/modules/init.py", line 1, in
from .network import TOTAL3D
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/modules/network.py", line 12, in
from models.loss import get_phy_loss_samples
File "/home/data4t/wyf/Implicit3DUnderstanding/models/loss.py", line 8, in
from external.pyTorchChamferDistance.chamfer_distance import ChamferDistance
File "/home/data4t/wyf/Implicit3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/init.py", line 3, in
from .chamfer_distance import ChamferDistance
File "/home/data4t/wyf/Implicit3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.py", line 8, in
build_directory="external/pyTorchChamferDistance/build")
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 644, in load
is_python_module)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 813, in jit_compile
with_cuda=with_cuda)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 866, in write_ninja_file_and_build
build_extension_module(name, build_directory, verbose)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 962, in build_extension_module
raise RuntimeError(message)
RuntimeError: Error building extension 'build': b"[1/2] /usr/local/cuda:/bin/nvcc -DTORCH_EXTENSION_NAME=build -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include/TH -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/cuda:/include -isystem /home/wyf/anaconda3/envs/Im3D/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /home/data4t/wyf/Implicit3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.cu -o chamfer_distance.cuda.o\nFAILED: chamfer_distance.cuda.o \n/usr/local/cuda:/bin/nvcc -DTORCH_EXTENSION_NAME=build -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include/TH -isystem /home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/cuda:/include -isystem /home/wyf/anaconda3/envs/Im3D/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /home/data4t/wyf/Implicit3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.cu -o chamfer_distance.cuda.o\n/bin/sh: 1: /usr/local/cuda:/bin/nvcc: not found\nninja: build stopped: subcommand failed.\n"

Then I changed the ['ninja', '-v'] in anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py to ['ninja', '--version']. And the error changed.

②Traceback (most recent call last):
File "main.py", line 8, in
import train, test,demo
File "/home/data4t/wyf/Implicit3DUnderstanding/train.py", line 4, in
from models.optimizers import load_optimizer, load_scheduler
File "/home/data4t/wyf/Implicit3DUnderstanding/models/init.py", line 1, in
from . import total3d, mgnet, ldif
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/init.py", line 1, in
from . import modules, training, config, dataloader
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/modules/init.py", line 1, in
from .network import TOTAL3D
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/modules/network.py", line 12, in
from models.loss import get_phy_loss_samples
File "/home/data4t/wyf/Implicit3DUnderstanding/models/loss.py", line 8, in
from external.pyTorchChamferDistance.chamfer_distance import ChamferDistance
File "/home/data4t/wyf/Implicit3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/init.py", line 3, in
from .chamfer_distance import ChamferDistance
File "/home/data4t/wyf/Implicit3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.py", line 8, in
build_directory="external/pyTorchChamferDistance/build")
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 644, in load
is_python_module)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 824, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 967, in _import_module_from_library
file, path, description = imp.find_module(module_name, [path])
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'build'

It seems that the installation of module "chamfer_distance" has failed. So I used the command pip install git+'https://github.com/otaheri/chamfer_distance' to install the module by myself and changed the 8th line in Implicit3DUnderstanding/models/loss.py to from chamfer_distance import ChamferDistance. Then I got the following error:

③Traceback (most recent call last):
File "main.py", line 8, in
import train, test,demo
File "/home/data4t/wyf/Implicit3DUnderstanding/train.py", line 4, in
from models.optimizers import load_optimizer, load_scheduler
File "/home/data4t/wyf/Implicit3DUnderstanding/models/init.py", line 1, in
from . import total3d, mgnet, ldif
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/init.py", line 1, in
from . import modules, training, config, dataloader
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/modules/init.py", line 1, in
from .network import TOTAL3D
File "/home/data4t/wyf/Implicit3DUnderstanding/models/total3d/modules/network.py", line 12, in
from models.loss import get_phy_loss_samples
File "/home/data4t/wyf/Implicit3DUnderstanding/models/loss.py", line 9, in
from chamfer_distance import ChamferDistance
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/chamfer_distance/init.py", line 1, in
from .chamfer_distance import ChamferDistance
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/chamfer_distance/chamfer_distance.py", line 10, in
f_path + '/chamfer_distance.cu'])
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 644, in load
is_python_module)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 824, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 967, in _import_module_from_library
file, path, description = imp.find_module(module_name, [path])
File "/home/wyf/anaconda3/envs/Im3D/lib/python3.6/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'cd'

So far,I have no idea about the errors. Would you like to give me any suggestions? Thank you ver much!My configuration is as follows.

  • nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 9.0, V9.0.176
    -gcc (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010 g++ (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
    NVIDIA-SMI 460.73.01 Driver Version: 460.73.01 CUDA Version: 11.2

  • ninja --version 1.10.0.git.kitware.jobserver-1

  • ` packages in environment at /home/wyf/anaconda3/envs/Im3D:

Name Version Build Channel
_libgcc_mutex 0.1 main conda-forge
blas 1.0 mkl conda-forge
bzip2 1.0.8 h7b6447c_0
ca-certificates 2020.12.5 ha878542_0 conda-forge
certifi 2020.12.5 py36h5fab9bb_1 conda-forge
cffi 1.14.0 py36he30daa8_1
chardet 3.0.4 pypi_0 pypi
click 7.1.2 pypi_0 pypi
cloudpickle 1.6.0 py_0 conda-forge
cmake 3.16.3 h28c56e5_0 conda-forge
configparser 5.0.0 pypi_0 pypi
cudatoolkit 9.0 h13b8566_0
curl 7.69.1 hbc83047_0
cycler 0.10.0 py_2 conda-forge
cython 0.29.21 py36he6710b0_0
cytoolz 0.11.0 py36h8c4c3a4_0 conda-forge
dask-core 2.28.0 py_0 conda-forge
decorator 4.4.2 py_0 conda-forge
docker-pycreds 0.4.0 pypi_0 pypi
enum34 1.1.10 py36h9f0ad1d_1 conda-forge
expat 2.2.6 he6710b0_0
freetype 2.9.1 h8a8886c_1
future 0.18.2 py36_1
geos 3.8.0 he6710b0_0
gitdb 4.0.5 pypi_0 pypi
gitpython 3.1.8 pypi_0 pypi
h5py 2.10.0 pypi_0 pypi
hdf4 4.2.13 h3ca952b_2
hdf5 1.10.4 hb1b8bf9_0
icu 58.2 he6710b0_3
idna 2.10 pypi_0 pypi
imagecodecs-lite 2019.12.3 py36h785e9b2_1 conda-forge
imageio 2.9.0 py_0 conda-forge
intel-openmp 2020.1 217
jellyfish 0.8.2 pypi_0 pypi
joblib 0.16.0 pypi_0 pypi
jpeg 9b h024ee3a_2
jsoncpp 1.8.4 hfd86e86_0
kiwisolver 1.2.0 py36hdb11119_0 conda-forge
krb5 1.17.1 h173b8e3_0
ld_impl_linux-64 2.33.1 h53a641e_7 conda-forge
libcurl 7.69.1 h20c2e04_0
libedit 3.1.20181209 hc058e9b_0
libffi 3.3 he6710b0_2
libgcc-ng 9.1.0 hdf63c60_0
libgfortran-ng 7.3.0 hdf63c60_0
libnetcdf 4.6.1 h11d0813_2
libogg 1.3.2 h7b6447c_0
libpng 1.6.37 hbc83047_0
libssh2 1.9.0 h1ba5d50_1
libstdcxx-ng 9.1.0 hdf63c60_0
libtheora 1.1.1 h5ab3b9f_1
libtiff 4.1.0 h2733197_0
libuv 1.40.0 hd18ef5c_0 conda-forge
libvorbis 1.3.6 h7b6447c_0
libxml2 2.9.10 he19cac6_1
lz4-c 1.8.1.2 h14c3975_0
matplotlib 3.2.2 pypi_0 pypi
mkl 2020.1 217
mkl-service 2.3.0 py36he904b0f_0
mkl_fft 1.0.15 py36ha843d7b_0
mkl_random 1.1.1 py36h0573a6f_0
ncurses 6.2 he6710b0_1
networkx 2.5 py_0 conda-forge
ninja 1.10.0.post1 pypi_0 pypi
numpy 1.18.1 py36h4f9e942_0
numpy-base 1.18.1 py36hde5b4d6_1
olefile 0.46 py36_0
opencv-python 4.2.0.34 pypi_0 pypi
openssl 1.1.1h h516909a_0 conda-forge
pandas 1.0.5 py36h0573a6f_0
pathlib 1.0.1 py36h9f0ad1d_2 conda-forge
pathtools 0.1.2 pypi_0 pypi
pillow 7.1.2 py36hb39fc2d_0
pip 20.0.2 py36_3
promise 2.3 pypi_0 pypi
protobuf 3.13.0 pypi_0 pypi
psutil 5.7.2 pypi_0 pypi
pycparser 2.20 py_2
pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge
pysocks 1.7.1 pypi_0 pypi
python 3.6.10 h7579374_2
python-dateutil 2.8.1 py_0 conda-forge
python_abi 3.6 1_cp36m conda-forge
pytorch 1.1.0 py3.6_cuda9.0.176_cudnn7.5.1_0 pytorch
pytz 2020.1 py_0
pywavelets 1.1.1 py36h68bb277_2 conda-forge
pyyaml 5.3.1 py36h7b6447c_0
readline 8.0 h7b6447c_0
requests 2.24.0 pypi_0 pypi
rhash 1.4.0 h36c2ea0_0 conda-forge
scikit-image 0.17.2 py36h7c3b610_2 conda-forge
scipy 1.4.1 py36h0b6359f_0
seaborn 0.10.1 pypi_0 pypi
sentry-sdk 0.17.8 pypi_0 pypi
setuptools 47.1.1 py36_0
shapely 1.7.1 py36h98ec03d_0
shortuuid 1.0.1 pypi_0 pypi
six 1.15.0 py_0
smmap 3.0.4 pypi_0 pypi
sqlite 3.31.1 h62c20be_1
subprocess32 3.5.4 pypi_0 pypi
tbb 2020.0 hfd86e86_0
tifffile 2019.7.26.2 py36_0 conda-forge
tk 8.6.8 hbc83047_0
toolz 0.11.1 py_0 conda-forge
torchvision 0.3.0 py36_cu9.0.176_1 pytorch
tornado 6.0.4 py36h8c4c3a4_1 conda-forge
tqdm 4.49.0 py_0
trimesh 3.8.10 pypi_0 pypi
urllib3 1.25.10 pypi_0 pypi
vtk 8.2.0 py36haa4764d_200
wandb 0.10.8 pypi_0 pypi
watchdog 0.10.3 pypi_0 pypi
wheel 0.34.2 py36_0 conda-forge
xz 5.2.5 h7b6447c_0
yaml 0.1.7 had09818_2
zlib 1.2.11 h7b6447c_3
zstd 1.3.7 h0b5b093_0 `

Error while running the demo via ssh

/bin/sh: 1: /dev/shm/tmpmmweeyxx/ldif2mesh: Permission denied

subprocess.CalledProcessError: Command '/dev/shm/tmpmmweeyxx/ldif2mesh /dev/shm/tmpmmweeyxx/ldif.txt /dev/shm/tmpmmweeyxx/serialized.occnet /dev/shm/tmpmmweeyxx/grid.grd -resolution 128 -extent 0.7' returned non-zero exit status 126.

Error

librenderer.render() (glViewport) throws segfault

Hi Cheng,

Thanks for your high quality code base for great results and nice summary of 3D toolbox. I wish to turn to you for help on one issue of segfault.

I encountered the problem of segfault when preprocessing the pix3d data. The segfault comes from librenderer.render when producing the depths. A closer check into the C code indicates that it is the glViewport function that throws the segfault. I tried to run the test and also encountered the segfault from the same place. I believe I have carefully installed the OpenGL, GLUT and GLEW packages through apt install and it is pretty hard to understand why the glViewport would throw the segfault. I used the headless mode with the xvfb utility. May I know if you have ever encountered the same problem and do you have any clues on this? Many thanks for your time!

Detection Evaluation Script in Python

Hi @chengzhag ,

Great work indeed! I had one quick question. Is the evaluation script (for object detection) also available in Python, so that it could be integrated with the testing module directly?

Appreciate your help.

Cheers!

2D detector output from Total3D

Hi @chengzhag,
thanks for this great contribution!
It is stated in the paper that: "We use the outputs of the 2D detector from Total3D as the input of our model.". Does this mean that 1) you used the exact same model and pre-trained weights provided by Total3D, or 2) you trained your own 2D detector in the same way as the authors of Total3D?

Furthermore, could you share this pre-computed 2D bounding boxes, or some instructions (model and weights if available) that makes it possible to re-produce the whole pipeline?

Thanks a lot in advance.

Training with self processed SUNRGBD dataset

I want to evaluate 3D detection, so I preprocessed SUNRGBD as stated in the README. While training the logs say that
180/10450 missing samples
80/5014 missing samples

Did I make a mistake while preprocessing or is this expected?

Thanks :)

confusion about the final chamfer distance for LDIF result

Hi, chengzhag.
Thanks for you excellent work.
I tried to reproduce the mesh generation part of your work, exactly the LDIF network, and I train this part followed the parameters mentioned in the paper, the best result I got from my reproduction was wicp_avg_chamfer=7.25, which remain a certain gap with the results shown in the paper(6.72). I am not sure if i missed some thing.
Another question. I used the checkpoint file provided in the readme file to get 6.72. However, the final statistical results of various categories are not quite consistent with those shown in the paper, so I would like to ask if there is any difference between the statistical results in the paper and the statistical methods in the code?
微信截图_20210830142401
微信截图_20210830142438

Failed to extract mesh with error: ValueError (Surface level must be within volume data range) . Setting to unit sphere.

Hello

Thank you for this fantastic job. Here is an issue:

No cmake in environment.yml :

(Im3D)  ... $ conda config --add channels conda-forge
(Im3D)  ... $ conda install cmake
(Im3D)   ...  $ conda list
# packages in environment at /......./miniconda3/envs/Im3D:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    conda-forge
blas                      1.0                         mkl    conda-forge
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2020.12.5            ha878542_0    conda-forge
certifi                   2020.12.5        py36h5fab9bb_1    conda-forge
cffi                      1.14.0           py36he30daa8_1  
chardet                   3.0.4                    pypi_0    pypi
click                     7.1.2                    pypi_0    pypi
cloudpickle               1.6.0                      py_0    conda-forge
cmake                     3.16.3               h28c56e5_0    conda-forge
configparser              5.0.0                    pypi_0    pypi
cudatoolkit               9.0                  h13b8566_0  
curl                      7.69.1               hbc83047_0  
cycler                    0.10.0                     py_2    conda-forge
cython                    0.29.21          py36he6710b0_0  
cytoolz                   0.11.0           py36h8c4c3a4_0    conda-forge
dask-core                 2.28.0                     py_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
docker-pycreds            0.4.0                    pypi_0    pypi
enum34                    1.1.10           py36h9f0ad1d_1    conda-forge
expat                     2.2.6                he6710b0_0  
freetype                  2.9.1                h8a8886c_1  
future                    0.18.2                   py36_1  
geos                      3.8.0                he6710b0_0  
gitdb                     4.0.5                    pypi_0    pypi
gitpython                 3.1.8                    pypi_0    pypi
h5py                      2.10.0                   pypi_0    pypi
hdf4                      4.2.13               h3ca952b_2  
hdf5                      1.10.4               hb1b8bf9_0  
icu                       58.2                 he6710b0_3  
idna                      2.10                     pypi_0    pypi
imagecodecs-lite          2019.12.3        py36h785e9b2_1    conda-forge
imageio                   2.9.0                      py_0    conda-forge
intel-openmp              2020.1                      217  
jellyfish                 0.8.2                    pypi_0    pypi
joblib                    0.16.0                   pypi_0    pypi
jpeg                      9b                   h024ee3a_2  
jsoncpp                   1.8.4                hfd86e86_0  
kiwisolver                1.2.0            py36hdb11119_0    conda-forge
krb5                      1.17.1               h173b8e3_0  
ld_impl_linux-64          2.33.1               h53a641e_7    conda-forge
libcurl                   7.69.1               h20c2e04_0  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libnetcdf                 4.6.1                h11d0813_2  
libogg                    1.3.2                h7b6447c_0  
libpng                    1.6.37               hbc83047_0  
libssh2                   1.9.0                h1ba5d50_1  
libstdcxx-ng              9.1.0                hdf63c60_0  
libtheora                 1.1.1                h5ab3b9f_1  
libtiff                   4.1.0                h2733197_0  
libuv                     1.40.0               hd18ef5c_0    conda-forge
libvorbis                 1.3.6                h7b6447c_0  
libxml2                   2.9.10               he19cac6_1  
lz4-c                     1.8.1.2              h14c3975_0  
matplotlib                3.2.2                    pypi_0    pypi
matplotlib-base           3.2.1            py36hef1b27d_0  
mkl                       2020.1                      217  
mkl-service               2.3.0            py36he904b0f_0  
mkl_fft                   1.0.15           py36ha843d7b_0  
mkl_random                1.1.1            py36h0573a6f_0  
ncurses                   6.2                  he6710b0_1  
networkx                  2.5                        py_0    conda-forge
ninja                     1.10.0.post1             pypi_0    pypi
numpy                     1.18.1           py36h4f9e942_0  
numpy-base                1.18.1           py36hde5b4d6_1  
olefile                   0.46                     py36_0  
opencv-python             4.2.0.34                 pypi_0    pypi
openssl                   1.1.1h               h516909a_0    conda-forge
pandas                    1.0.5            py36h0573a6f_0  
pathlib                   1.0.1            py36h9f0ad1d_2    conda-forge
pathtools                 0.1.2                    pypi_0    pypi
pillow                    7.1.2            py36hb39fc2d_0  
pip                       20.0.2                   py36_3  
promise                   2.3                      pypi_0    pypi
protobuf                  3.13.0                   pypi_0    pypi
psutil                    5.7.2                    pypi_0    pypi
pycparser                 2.20                       py_2  
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pysocks                   1.7.1                    pypi_0    pypi
python                    3.6.10               h7579374_2  
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.6                     1_cp36m    conda-forge
pytorch                   1.1.0           py3.6_cuda9.0.176_cudnn7.5.1_0    pytorch
pytz                      2020.1                     py_0  
pywavelets                1.1.1            py36h68bb277_2    conda-forge
pyyaml                    5.3.1            py36h7b6447c_0  
readline                  8.0                  h7b6447c_0  
requests                  2.24.0                   pypi_0    pypi
rhash                     1.4.0                h36c2ea0_0    conda-forge
scikit-image              0.17.2           py36h7c3b610_2    conda-forge
scipy                     1.4.1            py36h0b6359f_0  
seaborn                   0.10.1                   pypi_0    pypi
sentry-sdk                0.17.8                   pypi_0    pypi
setuptools                47.1.1                   py36_0  
shapely                   1.7.0            py36h98ec03d_0  
shortuuid                 1.0.1                    pypi_0    pypi
six                       1.15.0                     py_0  
smmap                     3.0.4                    pypi_0    pypi
sqlite                    3.31.1               h62c20be_1  
subprocess32              3.5.4                    pypi_0    pypi
tbb                       2020.0               hfd86e86_0  
tifffile                  2019.7.26.2              py36_0    conda-forge
tk                        8.6.8                hbc83047_0  
toolz                     0.11.1                     py_0    conda-forge
torchvision               0.3.0           py36_cu9.0.176_1    pytorch
tornado                   6.0.4            py36h8c4c3a4_1    conda-forge
tqdm                      4.49.0                     py_0  
trimesh                   3.8.10                   pypi_0    pypi
urllib3                   1.25.10                  pypi_0    pypi
vtk                       8.2.0           py36haa4764d_200  
wandb                     0.10.8                   pypi_0    pypi
watchdog                  0.10.3                   pypi_0    pypi
wheel                     0.34.2                   py36_0    conda-forge
xz                        5.2.5                h7b6447c_0  
yaml                      0.1.7                had09818_2  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.3.7                h0b5b093_0  

(Im3D) ... $ python project.py build

1

2

(Im3D)  ... $  CUDA_VISIBLE_DEVICES=0 python main.py out/total3d/20110611514267/out_config.yaml --mode demo --demo_path demo/inputs/1

gives

3

4

also, I had degraded to CUDA 10.0 on my UBUNTU 18.04

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

RuntimeError: cublas runtime error : the GPU program failed to execute at /tmp/pip-req-build-jh50bw28/aten/src/THC/THCBlas.cu:259

RuntimeError: cublas runtime error : the GPU program failed to execute at /tmp/pip-req-build-jh50bw28/aten/src/THC/THCBlas.cu:259

When I run:

CUDA_VISIBLE_DEVICES=0 xvfb-run -a -s "-screen 0 800x600x24" python main.py out/total3d/20110611514267/out_config.yaml --mode demo --demo_path demo/inputs/1

My environment:

(Im3D) xxx@viscam4:~/projects/ig_llm/rtx_3090/Implicit3DUnderstanding$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

(Im3D) xxx@viscam4:~/projects/ig_llm/rtx_3090/Implicit3DUnderstanding$ conda list torch
# packages in environment at /viscam/u/xxx/anaconda3/envs/Im3D:
#
# Name                    Version                   Build  Channel
pytorch                   1.1.0           cuda100py36he554f03_0  
torchvision               0.3.0           cuda100py36h72fc40a_0

(Im3D) xxx@viscam4:~/projects/ig_llm/rtx_3090/Implicit3DUnderstanding$ nvidia-smi
Sun Jul 21 14:15:57 2024       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.43.04    Driver Version: 515.43.04    CUDA Version: 11.7     |

(Im3D) xxx@viscam4:~/projects/ig_llm/rtx_3090/Implicit3DUnderstanding$ gpustat
viscam4.stanford.edu        Sun Jul 21 14:16:15 2024  515.43.04
[0] NVIDIA GeForce RTX 3090 | 37'C,   0 % |   308 / 24576 MB |

Bug (shown after a long time loading):

Begin to resume from the last checkpoint.
Loading checkpoint from out/total3d/20110611514267/model_best.pth.
Warning: Could not find epoch in checkpoint!
Warning: Could not find min_loss in checkpoint!
Warning: Could not find step in checkpoint!
set() subnet missed.
Checkpoint out/total3d/20110611514267/model_best.pth resumed.

Loading data.
Traceback (most recent call last):
  File "main.py", line 42, in <module>
    demo.run(cfg)
  File "/viscam/projects/inv_engine/xxx/ig_llm/rtx_3090/Implicit3DUnderstanding/demo.py", line 147, in run
    est_data = net(data)
  File "/viscam/u/xxx/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/viscam/projects/inv_engine/xxx/ig_llm/rtx_3090/Implicit3DUnderstanding/models/total3d/modules/network.py", line 112, in forward
    data['split'], data['rel_pair_counts'])
  File "/viscam/u/xxx/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/viscam/projects/inv_engine/xxx/ig_llm/rtx_3090/Implicit3DUnderstanding/models/total3d/modules/object_detection.py", line 103, in forward
    r_features = self.relnet(a_features, g_features, split, rel_pair_counts)
  File "/viscam/u/xxx/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/viscam/projects/inv_engine/xxx/ig_llm/rtx_3090/Implicit3DUnderstanding/models/total3d/modules/relation_net.py", line 54, in forward
    g_weights = self.fc_g(g_features)
  File "/viscam/u/xxx/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/viscam/u/xxx/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 92, in forward
    return F.linear(input, self.weight, self.bias)
  File "/viscam/u/xxx/anaconda3/envs/Im3D/lib/python3.6/site-packages/torch/nn/functional.py", line 1406, in linear
    ret = torch.addmm(bias, input, weight.t())
RuntimeError: cublas runtime error : the GPU program failed to execute at /tmp/pip-req-build-jh50bw28/aten/src/THC/THCBlas.cu:259

Error when I run the demo

Hi, @chengzhag

I got the error when I try to run the demo!

ImportError: external/pyTorchChamferDistance/build/build.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERK

I don't know why the undefined symbol occured?

Would appreciate your help with this.

How to evaluate on ObjectNet3D

Hello chengzhag,

Thanks for your work.

I noticed that you test your work on another dataset named ObjectNet3D, and I download it too. but what make me confused is that the intrinsic and extrinsic for camera is not provided in that dataset, and these parameters are needed.

Could you please give me some advice for this evaluation ?

Thank you!

similar problem

(Pano3D) fwj1@DESKTOP-60FGQL8:/mnt/d/wsl/pano/DeepPanoContext-main$ python project.py build
Building gaps...
Run: cd external && bash build_gaps.sh

CD inside the ldif/ldif python package

cd ldif

This should create a gaps/ folder at ldif/ldif/gaps/

if [[ -d gaps ]]
then
echo "GAPS has already been cloned to ldif/ldif/gaps, skipping."
else
git clone https://github.com/tomfunkhouser/gaps.git
fi

Necessary dependencies:

Figure out whether we are on MacOS or Linux:

if [[ $(uname -s) == Darwin* ]]
then
echo "On MacOS, GL dependencies should have shipped and OSMesa support is disabled."
else

On linux, the packages need to be installed.

sudo apt-get install mesa-common-dev libglu1-mesa-dev libosmesa6-dev libxi-dev libgl1-mesa-dev

For some reason on Ubuntu there can be a broken link from /usr/lib/x86_64-linux-gnu/libGL.so

to libGL.so.1.2.0 in the same directory, which does not exist. However libgl1-mesa-glx should

provide libGL.so.1.2.0. Reinstalling libgl1-mesa-glx results in libGL.so.1.2.0 correctly

existing in /usr/lib/x86_64-linux-gnu as it should.

sudo apt-get install --reinstall libgl1-mesa-glx
fi

If the above command(s) fail, get the GL/gl.h and GL/glu.h headers, OSMesa and GL

static libraries (osmesa on macos), delete the above code, and try again.

Now apply customizations to GAPS:

This should make a copy of the qview folder at ldif/ldif/gaps/apps/qview/

if [[ -d gaps/apps/qview ]]
then
echo "qview has already been copied into ldif/ldif/gaps/qview, skipping."
else
cp -R ./qview gaps/apps/
fi

Everything is local to GAPS from this point:

cd gaps

Ptsview and qview aren't built by default, adjust the makefile to build them.

sed commands are for script idempotency

sed -i.bak '/ptsview/d' ./apps/Makefile
sed -i.bak '/qview/d' ./apps/Makefile
echo " cd ptsview; $(MAKE) $(TARGET)" >> ./apps/Makefile
echo " cd qview; $(MAKE) $(TARGET)" >> ./apps/Makefile

Make GAPS (assuming 8 threads):

On MacOS, using OSMesa is more difficult, so we don't

if [[ ! $(uname -s) == Darwin* ]]
then
make mesa -j8
else
make -j8
fi
Building pyfusion...
Run: cd external/mesh_fusion/libfusiongpu && mkdir -p build && cd build && cmake .. && make && cd .. && /home/fwj1/anaconda3/envs/Pano3D/bin/python setup.py build_ext --inplace
nvcc fatal : Unsupported gpu architecture 'compute_30'
CMake Error at fusion_gpu_generated_fusion_zach_tvl1.cu.o.Release.cmake:219 (message):
Error generating
/mnt/d/wsl/pano/DeepPanoContext-main/external/mesh_fusion/libfusiongpu/build/CMakeFiles/fusion_gpu.dir//./fusion_gpu_generated_fusion_zach_tvl1.cu.o

make[2]: *** [CMakeFiles/fusion_gpu.dir/fusion_gpu_generated_fusion_zach_tvl1.cu.o] Error 1
make[1]: *** [CMakeFiles/fusion_gpu.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
File "project.py", line 166, in
globals()args.work
File "project.py", line 113, in build
subprocess.check_output(cmd, shell=True)
File "/home/fwj1/anaconda3/envs/Pano3D/lib/python3.7/subprocess.py", line 411, in check_output
**kwargs).stdout
File "/home/fwj1/anaconda3/envs/Pano3D/lib/python3.7/subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'cd external/mesh_fusion/libfusiongpu && mkdir -p build && cd build && cmake .. && make && cd .. && /home/fwj1/anaconda3/envs/Pano3D/bin/python setup.py build_ext --inplace' returned non-zero exit status 2.

Solving environment: failed for $ conda env create -f environment.yml

I think there's a bug in your repo. Running your command directly didn't work.

(base) mona@ard-gpu-01:~/Implicit3DUnderstanding$ conda env create -f environment.yml
Retrieving notices: ...working... done
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - torchvision==0.3.0=py36_cu9.0.176_1
  - pytorch==1.1.0=py3.6_cuda9.0.176_cudnn7.5.1_0

my system:

(base) mona@ard-gpu-01:~$ uname -a
Linux ard-gpu-01 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
(base) mona@ard-gpu-01:~$ lsb_release -a
LSB Version:	core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy
(base) mona@ard-gpu-01:~$ nvidia-smi
Tue Apr 25 13:47:22 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.105.17   Driver Version: 525.105.17   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   50C    P8    20W /  90W |    871MiB / 16384MiB |      8%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2480      G   /usr/lib/xorg/Xorg                361MiB |
|    0   N/A  N/A      2672      G   ...ome-remote-desktop-daemon        3MiB |
|    0   N/A  N/A      2711      G   /usr/bin/gnome-shell               35MiB |
|    0   N/A  N/A      3231      G   ...AAAAAAAAA= --shared-files       27MiB |
|    0   N/A  N/A      4381      G   ...9/usr/lib/firefox/firefox      320MiB |
|    0   N/A  N/A      9348      G   ...hLaVGrkpw/usr/bin/meshlab      118MiB |
+-----------------------------------------------------------------------------+
(base) mona@ard-gpu-01:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

(base) mona@ard-gpu-01:~$ conda --version
conda 23.3.1
(base) mona@ard-gpu-01:~$ python --version
Python 3.9.13
(base) mona@ard-gpu-01:~$ python
Python 3.9.13 (main, Aug 25 2022, 23:26:10) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

About Layout Estimation Network Training

Hello, I am trying to reproduce your baseline. I prepared data and other stuff by following your instructions. When I started to train both LEN and LIEN+LDIF, I saw that the loss convergence is as expected for LIEN+LDIF but I do not think the LEN trains as expected. Even though the best model is trained in 4th epochs and remain the same until 53th epochs (I trained until 53 so far and it does not seem promising), the config file says it will be trained for 100 epochs. Thus, I would like to ask you whether any problem with LEN or what I should expect as a traning behavior? Thank you.

Visualization results different from paper outputs

Hello,
We followed the training steps provided and then tested the ldif and total3d with the following
python main.py out/[ldif/total3d]/[start_time]/out_config.yaml --mode test
However, outputs from the visualization seems to be different from the paper results.

This is the expected output:
photo_2021-06-01_22-23-43

This is our output from visualization:
photo_2021-06-01_22-23-50

Do you have any idea what we are doing wrong? Thanks :)

Pretraining weight link invalid

Hi,

Thank you for releasing the code. In your "Pretraing" section, you mentioned that:
"Pretraining
We use the pretrained checkpoint of Total3DUnderstanding to load weights for ODN."

The link of pretrained checkpoint is invalid now. Could you please update the link?

In addition, is this link represent the pretrained weight in the pretrain section of Total3DUnderstanding? Or the final weight after whole Total3DUnderstanding training?

Thank you in advance for your help!

Use only CPU

Hello guys,

What settings should be configured in this code to ensure it only uses the CPU and not the GPU?

Internal compiler error: Segmentation fault

Hello,

While building with python project.py build

I got the following error:

image

/usr/include/c++/10/chrono:473:154: required from here /usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault 428 | _S_gcd(intmax_t __m, intmax_t __n) noexcept | ^~~~~~

My OS: Ubuntu 21.04
Shipped gcc version:10.3
Installed gcc version: 9.3.0
nvcc version: 11.2
Nvidia-smi:
image

Thanks for the help

Error in building the project

Hi @chengzhag ,

I got the following error while building the project. Seems like there are some missing files.

Building pyrender...
Run: cd external/mesh_fusion/librender && /home/user/anaconda3/envs/pytorch11_py3_Im3D/bin/python setup.py build_ext --inplace
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/user/anaconda3/envs/pytorch11_py3_Im3D/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1832:0,
                 from /home/user/anaconda3/envs/pytorch11_py3_Im3D/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /home/user/anaconda3/envs/pytorch11_py3_Im3D/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from pyrender.cpp:531:
/home/user/anaconda3/envs/pytorch11_py3_Im3D/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^
In file included from pyrender.cpp:534:0:
offscreen.h:4:21: fatal error: GL/glew.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Traceback (most recent call last):
  File "project.py", line 158, in <module>
    globals()[args.work](args)
  File "project.py", line 120, in build
    subprocess.check_output(cmd, shell=True)
  File "/home/user/anaconda3/envs/pytorch11_py3_Im3D/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/home/user/anaconda3/envs/pytorch11_py3_Im3D/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'cd external/mesh_fusion/librender && /home/user/anaconda3/envs/pytorch11_py3_Im3D/bin/python setup.py build_ext --inplace' returned non-zero exit status 1.

It seems there is no directory called GL. Hence, any reference to headers included in it would probably throw an error.

Would appreciate your help with this.

~Cheers!

RuntimeError: cublas runtime error : the GPU program failed to execute at /tmp/pip-req-build-9xcrj8au/aten/src/THC/THCBlas.cu:259

I read somewhere it might be data loading issue or it can be pytorch version issue. Can you help to rectify?

Begin to resume from the last checkpoint.
Loading checkpoint from out/total3d/20110611514267/model_best.pth.
Warning: Could not find epoch in checkpoint!
Warning: Could not find min_loss in checkpoint!
Warning: Could not find step in checkpoint!
set() subnet missed.
Checkpoint out/total3d/20110611514267/model_best.pth resumed.
----------------------------------------------------------------------------------------------------
Loading data.
Traceback (most recent call last):
  File "main.py", line 42, in <module>
    demo.run(cfg)
  File "/workspace/hardik/Implicit3DUnderstanding/demo.py", line 147, in run
    est_data = net(data)
  File "/workspace/hardik/Implicit3DUnderstanding/workspace/.conda/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/workspace/hardik/Implicit3DUnderstanding/models/total3d/modules/network.py", line 97, in forward
    lo_centroid_result, lo_coeffs_result, a_features = self.layout_estimation(data['image'])
  File "/workspace/hardik/Implicit3DUnderstanding/workspace/.conda/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/workspace/hardik/Implicit3DUnderstanding/workspace/.conda/envs/Im3D/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/workspace/hardik/Implicit3DUnderstanding/workspace/.conda/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/workspace/hardik/Implicit3DUnderstanding/models/total3d/modules/layout_estimation.py", line 63, in forward
    cam = self.fc_1(x)
  File "/workspace/hardik/Implicit3DUnderstanding/workspace/.conda/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/workspace/hardik/Implicit3DUnderstanding/workspace/.conda/envs/Im3D/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 92, in forward
    return F.linear(input, self.weight, self.bias)
  File "/workspace/hardik/Implicit3DUnderstanding/workspace/.conda/envs/Im3D/lib/python3.6/site-packages/torch/nn/functional.py", line 1406, in linear
    ret = torch.addmm(bias, input, weight.t())
RuntimeError: cublas runtime error : the GPU program failed to execute at /tmp/pip-req-build-9xcrj8au/aten/src/THC/THCBlas.cu:259

Testing typo

In testing section you said In case you want to test LIEN+LDIF or full model by yourself:

python main.py out/[ldif/total3d]/[start_time]/model_best.pth --mode test
But I think it should be
python main.py out/[ldif/total3d]/[start_time]/out_config.yaml --mode test

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.