Git Product home page Git Product logo

atlas's Introduction

ATLAS: End-to-End 3D Scene Reconstruction from Posed Images

Zak Murez, Tarrence van As, James Bartolozzi, Ayan Sinha, Vijay Badrinarayanan, and Andrew Rabinovich

Quickstart

We provide a Colab Notebook to try inference.

Installation

We provide a docker image Docker/Dockerfile with all the dependencies.

Or you can install them yourself:

conda install -y pytorch=1.5.0 torchvision=0.6.0 cudatoolkit=10.2 -c pytorch
conda install opencv
pip install \
  open3d>=0.10.0.0 \
  trimesh>=3.7.6 \
  pyquaternion>=0.9.5 \
  pytorch-lightning>=0.8.5 \
  pyrender>=0.1.43
python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.5/index.html

For 16bit mixed precision (default training setting) you will also need NVIDIA apex

git clone https://github.com/NVIDIA/apex
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./apex

For headless rendering with pyrender (used for evaluation) see installation instructions here.

For inference with COLMAP see installation instructions here.

(If you have problems running the code try using the exact versions specified... for example the pytorch-lightning API has not settled yet).

Data Preperation

Sample

We provide a small sample scene for easy download and rapid inference. Download and extract the data to DATAROOT. The directory structure should look like:

DATAROOT
└───sample
│   └───sample1
│       │   intrinsics.txt
│       └───color
│       │   │   00000001.jpg
│       │   │   00000002.jpg
│       │   │   ...
│       └───pose
│           │   00000001.txt
│           │   00000002.txt
│           │   ...

Next run our data preperation script which parses the raw data format into our common json format (more info here) (note that we store our derivered data in a seperate folder METAROOT to prevent pollution of the original data).

python prepare_data.py --path DATAROOT --path_meta METAROOT --dataset sample

Scannet

Download and extract Scannet by following the instructions provided at http://www.scan-net.org/. You also need to download the train/val/test splits and the label mapping from https://github.com/ScanNet/ScanNet (Benchmark Tasks). The directory structure should look like:

DATAROOT
└───scannet
│   └───scans
│   |   └───scene0000_00
│   |       └───color
│   |       │   │   0.jpg
│   |       │   │   1.jpg
│   |       │   │   ...
│   |       │   ...
│   └───scans_test
│   |       └───color
│   |       │   │   0.jpg
│   |       │   │   1.jpg
│   |       │   │   ...
│   |       │   ...
|   └───scannetv2-labels.combined.tsv
|   └───scannetv2_test.txt
|   └───scannetv2_train.txt
|   └───scannetv2_val.txt

Next run our data preperation script which parses the raw data format into our common json format (more info here) (note that we store our derivered data in a seperate folder METAROOT to prevent pollution of the original data). This script also generates the ground truth TSDFs using TSDF Fusion.

python prepare_data.py --path DATAROOT --path_meta METAROOT --dataset scannet

This will take a while (a couple hours on 8 Quadro RTX 6000's)... if you have multiple gpus you can use the --i and --n flags to run in parallel

python prepare_data.py --path DATAROOT --path_meta METAROOT --dataset scannet --i 0 --n 4 &
python prepare_data.py --path DATAROOT --path_meta METAROOT --dataset scannet --i 1 --n 4 &
python prepare_data.py --path DATAROOT --path_meta METAROOT --dataset scannet --i 2 --n 4 &
python prepare_data.py --path DATAROOT --path_meta METAROOT --dataset scannet --i 3 --n 4 &

Note that if you do not plan to train you can prepare just the test set using the --test flag.

Your own data

To use your own data you will need to put it in the same format as the sample data, or implement your own version of something like sample.py. After that you can modify prepare_data.py to also prepare your data. Note that the pretrained models are trained with Z-up metric coordinates and do not generalize to other coordinates (this means that the scale and 2 axes of the orientation ambiguity of SFM must be resolved prior to using the poses).

Inference

Once you have downloaded and prepared the data (as described above) you can run inference using our pretrained model (download) or by training your own (see below).

To run on the sample scene use:

python inference.py --model results/release/semseg/final.ckpt --scenes METAROOT/sample/sample1/info.json

If your GPU does not have enough memory you can reduce voxel_dim (at the cost of possible clipping the scene)

python inference.py --model results/release/semseg/final.ckpt --scenes METAROOT/sample/sample1/info.json --voxel_dim 208 208 80

Note that the values of voxel_dim must be divisible by 8 using the default 3D network.

Results will be saved to:

results/release/semseg/test_final/sample1.ply // mesh
results/release/semseg/test_final/sample1.npz // tsdf
results/release/semseg/test_final/sample1_attributes.npz // vertex semseg

To run on the entire Scannet test set use:

python inference.py --model results/release/semseg/final.ckpt

Evaluation

After running inference on Scannet you can run evaluation using:

python evaluate.py --model results/release/semseg/test_final/

Note that evaluate.py uses pyrender to render depth maps from the predicted mesh for 2D evaluation. If you are using headless rendering you must also set the enviroment variable PYOPENGL_PLATFORM=osmesa (see pyrender for more details).

You can print the results of a previous evaluation run using

python visualize_metrics.py --model results/release/semseg/test_final/

Training

In addition to downloadinng and prepareing the data (as described above) you will also need to download our pretrained resnet50 weights (ported from detectron2) and unnzip it.

Then you can train your own models using train.py.

Configuration is controlled via a mix of config.yaml files and command line arguments. We provide a few sample config files used in the paper in configs/. Experiment names are specified by TRAINER.NAME and TRAINER.VERSION, which default to atlas and default. See config.py for a full list of parameters.

python train.py --config configs/base.yaml TRAINER.NAME atlas TRAINER.VERSION base
python train.py --config configs/semseg.yaml TRAINER.NAME atlas TRAINER.VERSION semseg

To watch training progress use

tensorboard --logdir results/

COLMAP Baseline

We also provide scripts to run inference and evaluataion using COLMAP. Note that you must install COLMAP (which is included in our docker image).

For inference on the sample scene use

python inference_colmap.py --pathout results/colmap --scenes METAROOT/sample/sample1/info.json

and for Scannet

python inference_colmap.py --pathout results/colmap

To evaluate Scannet use

python evaluate_colmap.py --pathout results/colmap

Citation

@inproceedings{murez2020atlas,
  title={Atlas: End-to-End 3D Scene Reconstruction from Posed Images},
  author={Zak Murez and 
          Tarrence van As and 
          James Bartolozzi and 
          Ayan Sinha and 
          Vijay Badrinarayanan and 
          Andrew Rabinovich},
  booktitle = {ECCV},
  year      = {2020},
  url       = {https://arxiv.org/abs/2003.10432}
}

atlas's People

Contributors

adujardin avatar tarrencev avatar zmurez avatar zmurez-ml 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  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

atlas's Issues

Results with icl-nuim dataset

Hello, thanks for work. I wanted to understand what types of matrix you used, so i tried icl-nuim dataset and get pretty strange results.
Снимок экрана 2021-01-26 в 17 17 19
What can do wrong? Can you explain format your pose matrix? World to camera or camera to world? Maybe you use opengl matrix type, how can I transform opengl matrix to your matrix

Question for num_frames

Thank you for opening the code.
I have a question about the number of frames.

In ScanNet test set,
the maximum number of color images in each scene is 84,
but mostly there are about 20 images in each scene.

Why did you intentionally set the number of frames as 500 for testing??
It just repeatedly use identical images in the dataloader.
So is there any intuition that you have in your mind?

Error on running inference on the sample dataset

Traceback (most recent call last):
File "inference.py", line 24, in
from atlas.model import VoxelNet
File "/home/csgfws/3dreconDuplicate/Atlas/atlas/model.py", line 29, in
from atlas.backbone2d import build_backbone2d
File "/home/csgfws/3dreconDuplicate/Atlas/atlas/backbone2d.py", line 8, in
from detectron2.layers import Conv2d, get_norm
File "/home/csgfws/3dreconDuplicate/env/lib/python3.8/site-packages/detectron2/layers/init.py", line 3, in
from .deform_conv import DeformConv, ModulatedDeformConv
File "/home/csgfws/3dreconDuplicate/env/lib/python3.8/site-packages/detectron2/layers/deform_conv.py", line 10, in
from detectron2 import _C
ImportError: /home/csgfws/3dreconDuplicate/env/lib/python3.8/site-packages/detectron2/_C.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceISt7complexIdEEEPKNS_6detail12TypeMetaDataEv

The environment has been setup as per the instructions in the README, however on running the command (python inference.py --model results/release/semseg/final.ckpt --scenes METAROOT/sample/sample1/info.json) the above error occurs

can atlas be used to reconstruct models with photos not videos?

thanks for your work at first. We tried with atlas with our data captured using our devices but it generate nothing at last. we don't feed atlas with videos or continuous images, instead we feed it with photo sequences with poses. any reply will be appreciated.

Motivation for the RandomTransformSpace augmentation

Hi,

May I ask what the motivation is to perform the random rotation and translation of the tsdf volume during training?

transforms.RandomTransformSpace(

I understand we may need to padding and cropping the ground truth tsdf volume to fit the pre-defined training volume size. However, why shall we rotate and translate it?

I thought it was for the pose error caused by the BundleFusion. But is there such a big error, 360 degree rotation along z-axis and 3 meter translation, according to the value in the code?

r = torch.rand(1) * 2*np.pi

t = torch.rand(3)

Or it is just for the model to adjust to different world coordinate system? I may miss something here. Any insight is appreciated.

Thank you in advances!

About nn_correspondance in evaluation

Thanks for your nice work!
I have a question about evaluation.

Pred trimed mesh (tsdf-fusion from render depth) is a two-layer geometry. Is it reasonable to compute correspondence distance between pred trimed mesh and scene0xxx_xx_vh_clean_2.ply (one-layer)?

For example,
image
red is gt (scene0xxx_xx_vh_clean_2.ply), white is trimed mesh.

Why not using gt trimed mesh (tsdf-fusion from gt depth) as ground truth for distance computing?
And I get following result by doing this:

dist1 0.093
dist2 0.077
prec 0.643
recal 0.633
fscore 0.633,

which is much better than the result in your paper.

About the visualization

Thanks for your nice work. Your code help me a lot. I have seen some videos about the 3d dynamic visualization. I think it's cool and useful. Can you tell me some information about the dynamic visualization of the results? Thank you very much. Maybe you use one professional 3D software?

Cannot install opencv package using conda

This is what I get

conda install opencv
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  • opencv -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

Weird Mesh from provided Colab example

After running the colab provided example, it came out a weird result (see attached screenshot from cloudcompare). I didnt get any error apart from

# run inference
!python inference.py --model results/release/semseg/final.ckpt --scenes data/sample/sample1/info.json --voxel_dim 208 208 80

0 1 sample sample1 0 250
/usr/local/lib/python3.6/dist-packages/detectron2/modeling/backbone/fpn.py:133: UserWarning: Mixed memory format inputs detected while calling the operator. The operator will output channels_last tensor even if some of the inputs are not in channels_last format. (Triggered internally at  /pytorch/aten/src/ATen/native/TensorIterator.cpp:924.)
  prev_features = lateral_features + top_down_features
0 1 sample sample1 25 250
0 1 sample sample1 50 250
0 1 sample sample1 75 250
0 1 sample sample1 100 250
0 1 sample sample1 125 250
0 1 sample sample1 150 250
0 1 sample sample1 175 250
0 1 sample sample1 200 250
0 1 sample sample1 225 250

Is this warning the root of the problem? How can I solve it?

Can anyone show the expected result from this example? Thx a lot

Screenshot from 2020-08-17 11-00-08

Pose Data from ARKit

I'm trying to see if I could use the pose data from ARKit with Atlas as suggested by @zmurez-ml in issue #2. However, Atlas is returning either 0 vertex models or completely unrelated irrelevant shapes like the one below (should be a kitchen instead)

Capture

The pose data is generated from ARKit, and the coordinate system is converted from the right-handed convention to the left-handed by multiplying the pose data with this matrix [[1,0,0,0],[0,1,0,0],[0,0,-1,0],[0,0,0,1]] and converted from millimeters to meters.

The images are captured at the rate of 10 frames per second.

I know this isn't enough information, but I'm not sure what more information would help solve the issue so please do let me know.

Thanks

AssertionError: Requires pyyaml>=5.1 on colab

While I run the colab script I get an AssertionError when I run the inference cell. How can I fix that, please forgive me if the answer is too obvious.

Traceback (most recent call last):
File "inference.py", line 24, in
from atlas.model import VoxelNet
File "/root/Atlas/atlas/model.py", line 29, in
from atlas.backbone2d import build_backbone2d
File "/root/Atlas/atlas/backbone2d.py", line 8, in
from detectron2.layers import Conv2d, get_norm
File "/usr/local/lib/python3.6/dist-packages/detectron2/init.py", line 5, in
setup_environment()
File "/usr/local/lib/python3.6/dist-packages/detectron2/utils/env.py", line 98, in setup_environment
_configure_libraries()
File "/usr/local/lib/python3.6/dist-packages/detectron2/utils/env.py", line 80, in _configure_libraries
assert get_version(yaml) >= (5, 1), "Requires pyyaml>=5.1"
AssertionError: Requires pyyaml>=5.1

Confusion about final loss

@zmurez-ml First of all, thanks for this amazing work. I am training the network with some modification however during training, the networks learns to output only 1's as the loss is dominated by free space. To solve this you mentioned in the paper that the loss is only back propogated through observed space (i.e., between 1 and -1) which you also used. However, I am confused that if this is the case and we mask the final output for target tsdf values b/w 1 and -1, how does network learn the free space as no loss is calculated here i.e., no flow of gradients.

suspected discrepancy in units with hololens2

Hi,
I was wondering if anyone has any experience running the project with Hololens2?
You can find the python file I had used to convert below.

convertPVtoAtlas.txt

The file only creates an output (wrong) if I multiply the non 0, and 1 elements by 2.

I was also wondering what the units the project uses,
Thanks!

Bad Type Name in sample1.ply

Hi, when trying to visualize the sample1.ply file in both MeshLab or CloudCompare, given by both the colab notebook and running inference on my local machine, I get a Bad Type Name, which I've traced to being due to property int64 semseg.

When I try to replace it with property int semseg, it gives me bad vertex index in face.

What should I do?

Also, what is the best way to visualize the outputs?

Pretrained plane model

There is a retrained model with semantic segmentation head. Can you please also upload the plain one?

model weights are not loaded

Good day. Model weights are not loaded.

import os

import numpy as np
import torch

from atlas.data import SceneDataset, parse_splits_list
from atlas.model import VoxelNet
import atlas.transforms as transforms
model = VoxelNet
model.load_from_checkpoint(checkpoint_path='final.ckpt')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-89c83cb76361> in <module>()
----> 1 model.load_from_checkpoint(checkpoint_path='final.ckpt')

/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/pytorch_lightning/core/saving.py in load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, **kwargs)
    155         checkpoint[cls.CHECKPOINT_HYPER_PARAMS_KEY].update(kwargs)
    156 
--> 157         model = cls._load_model_state(checkpoint, strict=strict, **kwargs)
    158         return model
    159 

/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/pytorch_lightning/core/saving.py in _load_model_state(cls, checkpoint, strict, **cls_kwargs_new)
    197             _cls_kwargs = {k: v for k, v in _cls_kwargs.items() if k in cls_init_args_name}
    198 
--> 199         model = cls(**_cls_kwargs)
    200 
    201         # give model a chance to load something

/home/ubuntu/kot/Atlas/atlas/model.py in __init__(self, hparams)
     91 
     92         # see config.py for details
---> 93         self.hparams = hparams
     94 
     95         # pytorch lightning does not support saving YACS CfgNone

/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/nn/modules/module.py in __setattr__(self, name, value)
    636                     buffers[name] = value
    637                 else:
--> 638                     object.__setattr__(self, name, value)
    639 
    640     def __delattr__(self, name):

AttributeError: can't set attribute

You can tell what could be wrong. I use the environment as required.

Inference With Latest COLMAP Broken

Trying to run the inference code with the latest versions of COLMAP does not work. I believe this is due to changes in the arguments and the expected folder structure under the working directories. I modified inference_colmap.py to use 'inputimages' rather than 'images' throughout to avoid conflicting with the folder COLMAP places undistorted images into.

colab code not working

can anyone look at colab code, i need some help, i tried different version but still cannot make it work. cannot generate .ply file.

Parameters for fine-tuning

Can @zmurez, or anyone else, suggest a configuration for training / fine-tuning Atlas that can learn acceptably well for experimentation using only a single GPU? I wonder if zmurez discovered such a configuration during development.

I will try decreasing VOXEL_DIM_TRAIN, NUM_FRAMES_TRAIN, and RESNETS.DEPTH. However, the convergence time is so long that a hint here could save a lot of time.

Thanks

About num of epochs

Hi, thanks for sharing the code.
What's the number of epochs required to reproduce the results in the paper?

About fine-tuned model on Scannet.

Thanks for your nice work!
According to your paper, you have fine-tuned the baseline methods MVDepthNet, GPMVS, and DPSNet on the ScanNet dataset.
I wonder if you could share the fine-tuned models with us? I'm working on a follow-up work of Atlas and I'm making some modifications to the depth map filtering and fusion pipeline so that I will need to re-run all the TSDF integration and evaluation metrics.
Sharing the predicted depth maps on the ScanNet will also suit my needs, however, the files to share will be in a much larger size.
Thanks a lot!

About feature volumes accumulation

In your paper, Eq(3) and Eq(4) give the specific implementation about how to accumulate feature volumes into one. But I found the codes here are not based on the Eq(3) because V_t-1 doesn't multiply W_t-1. Could you help me with this confusion ? Thanks!

Error while running inference

I am unable to open the 3D model. It says failed to load the model. I have tried many .ply file readers online as well, but i don't see any 3D scene. Please guide.

ScanNet result

First of all, thank you very much for sharing your source code.

I think I've met a similar issue to #16 .
I've tried the inference and evaluation script on some of the ScanNet sequences, then I found that the scale of the depth prediction might be wrong.
The evaluation result shows the depth RMSE is more than 1 meter, which is far bigger than the number reported in the paper. However, if I divide depth_pred by 10.0, the result number looks reasonable.

Do you have any idea?

These are steps I took to run the evaluation

  • Download ScanNet sequence (for example, scene0100_00)
  • Extract .sens file to several folders (color,depth,pose and intrinsic) using reader.py
  • Create metafile, run inference using the pre-trained model and evaluate the result

pip package version specification ">=" and redirection

This must be the most "hilarious" bug have been reported.

When I use the provided command to install pip packages, It turns out nothing happen (no output and not return). I just wait and realise that something is wrong. But I don't know where. Then I checked the conda envs directory and found some files named as '=0.10.0.0', '=0.8.5' ... I guess that the command
pip install open3d>=0.10.0.0
must be translated as pip install open3d and redirect the stdout to a file '=0.10.0.0'. :-D
Then I open these files and the contents are just the output of pip install which should be printed to the terminal instead.

It confused me half an hour and searched for many solutions. But I didn't find an issue about this here. Am I the only one came into this issue?

hope this can help someone else and the author could get some chage of the Readme.

Values in pose.txt

With reference to issue #7
@zmurez could you please elaborate on the values present in the pose.txt file. What does each value stand for?

Thanks in advance

c++: internal compiler error: Killed (program cc1plus)

When running docker build . in the Docker dir, I ran into some CMake errors; anyone else experiencing this on mac os 10.15.6?

[ 52%] Building CXX object internal/ceres/CMakeFiles/ceres.dir/residual_block.cc.o
internal/ceres/CMakeFiles/ceres.dir/build.make:734: recipe for target 'internal/ceres/CMakeFiles/ceres.dir/covariance_impl.cc.o' failed
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
make[2]: *** [internal/ceres/CMakeFiles/ceres.dir/covariance_impl.cc.o] Error 4
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [internal/ceres/CMakeFiles/ceres.dir/all] Error 2
CMakeFiles/Makefile2:117: recipe for target 'internal/ceres/CMakeFiles/ceres.dir/all' failed
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c cmake -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF .. && make -j$(nproc) && make install && make clean' returned a non-zero code: 2

Docker version

docker --version                                                                                                 
Docker version 19.03.12, build 48a66213fe

For posterity, I'm asking for any tips on how you resolved this. Future me will be really grateful.

About inference_colmap.py

Hi, I have not seen the place where you load your pretrained model, could you give me some tips about how to use your final.ckpt in inference_colmap.py?

Running inference with custom data

Having run the inference.py with custom data, I get the outputs but Meshlab shows no vertex found in the .obj file.
I am using the pretrained model provided by atlas.

Keep getting "illegal memory access" during training

Hi Zak,

Thanks for sharing the code for your amazing work.

I am trying to run the training model, but keep getting the error saying illegal memory access was encountered. It sometimes happens at the very beginning, while sometimes happens in the middle of training. The trackback messages are also various. Please refer to the 2 examples below for the error message.

I am training only on 2 scenes, with 2 GPUs, python3.7, CUDA 10.2, and open3d==0.9. All the other packages are installed based on the README. I suspect it is related to GPU synchronization and probably pytorch-lightening.

Do you have any insight for this error?

Thank you in advance.

=================
Example 1 -- happen at very begining

----------------------------------------------
0 | backbone2d | Sequential     | 27 M  
1 | backbone3d | EncoderDecoder | 2 M   
2 | heads2d    | PixelHeads     | 0     
3 | heads3d    | VoxelHeads     | 4 K   
Validation sanity check: 0it [00:00, ?it/s]transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
Traceback (most recent call last):                                                                                                                                                 
  File "/home/fuy34/Dropbox/Atlas-master/train.py", line 63, in <module>
    trainer.fit(model)

 ... (omit some Traceback message) 

 File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/fuy34/Dropbox/Atlas-master/atlas/heads3d.py", line 202, in forward
    if mask_surface.sum()>0:

RuntimeError: CUDA error: an illegal memory access was encountered
terminate called after throwing an instance of 'c10::Error'
  what():  CUDA error: an illegal memory access was encountered (insert_events at /opt/conda/conda-bld/pytorch_1587428266983/work/c10/cuda/CUDACachingAllocator.cpp:771)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x4e (0x7f7c71b74b5e in /home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/torch/lib/libc10.so)
frame #1: c10::cuda::CUDACachingAllocator::raw_delete(void*) + 0x6d0 (0x7f7c7192fe30 in /home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/torch/lib/libc10_cuda.so)
frame #2: c10::TensorImpl::release_resources() + 0x4d (0x7f7c71b626ed in /home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/torch/lib/libc10.so)
frame #3: <unknown function> + 0x51ee0a (0x7f7ca279fe0a in /home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
frame #4: <unknown function> + 0x1a350e (0x5563a0bec50e in /home/fuy34/anaconda3/envs/Atlas/bin/python)
frame #5: <unknown function> + 0x10df7c (0x5563a0b56f7c in /home/fuy34/anaconda3/envs/Atlas/bin/python)
frame #6: <unknown function> + 0x10e0d7 (0x5563a0b570d7 in /home/fuy34/anaconda3/envs/Atlas/bin/python)


Example 2 -- happens at epoch 4, the scene suddenly reduce to 1 for no reason after one 1 epoch, and the Trackback message is different from the previous one

Epoch 0:   0%|                                                                                                                                               | 0/2 [00:00<?, ?it/s]transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
Epoch 1:   0%|                                                                                                                       | 0/1 [00:00<?, ?it/s, loss=2.557, v_num=mseg]transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
Epoch 2:   0%|                                                                                                                       | 0/1 [00:00<?, ?it/s, loss=2.623, v_num=mseg]transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
Gradient overflow.  Skipping step, loss scaler 0 reducing loss scale to 32768.0
Gradient overflow.  Skipping step, loss scaler 0 reducing loss scale to 32768.0
Epoch 3:   0%|                                                                                                                       | 0/1 [00:00<?, ?it/s, loss=2.464, v_num=mseg]transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
Epoch 4:   0%|                                                                                                                       | 0/1 [00:00<?, ?it/s, loss=2.419, v_num=mseg]transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
transform tensor([[0., 0., 0.]])
Traceback (most recent call last):
  File "train.py", line 63, in <module>
    trainer.fit(model)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/trainer/states.py", line 48, in wrapped_fn
    result = fn(self, *args, **kwargs)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1058, in fit
    results = self.accelerator_backend.spawn_ddp_children(model)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/accelerators/ddp_backend.py", line 123, in spawn_ddp_children
    results = self.ddp_train(local_rank, mp_queue=None, model=model, is_master=True)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/accelerators/ddp_backend.py", line 224, in ddp_train
    results = self.trainer.run_pretrain_routine(model)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1239, in run_pretrain_routine
    self.train()
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/trainer/training_loop.py", line 394, in train
    self.run_training_epoch()
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/trainer/training_loop.py", line 491, in run_training_epoch
    batch_output = self.run_training_batch(batch, batch_idx)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/trainer/training_loop.py", line 844, in run_training_batch
    self.hiddens
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/trainer/training_loop.py", line 1076, in optimizer_closure
    model_ref.backward(self, closure_loss, optimizer, opt_idx)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/pytorch_lightning/core/hooks.py", line 324, in backward
    loss.backward()
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/torch/tensor.py", line 198, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/fuy34/anaconda3/envs/Atlas/lib/python3.7/site-packages/torch/autograd/__init__.py", line 100, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: copy_if failed to synchronize: cudaErrorIllegalAddress: an illegal memory access was encountered

Format of Pose in 0000000*.txt in DATAROOT/sample/sample1/pose/

Hi @zmurez ; Could you please discuss the format of data in each rgb corresponding pose's text file in DATAROOT/sample/sample1/pose/ ?

For example : 00000001.txt contains
6.208292841911315918e-01 -2.021953016519546509e-01 7.574220299720764160e-01 5.417202062606811808e+00 -7.820422649383544922e-01 -9.244704246520996094e-02 6.163306236267089844e-01 4.002395458221435831e+00 -5.459773540496826172e-02 -9.749721288681030273e-01 -2.155191004276275635e-01 2.021697369813919121e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00

GPU Memory Required for Inference

Hi

The paper mentions the type of GPU used but not the amount of memory per device. I was wondering if you could provide some additional information, mainly for inference at this point. Trying to run this on a 16GB with the sample dataset is causing an "CUDA out of memory" error when trying to run the second step in the inference (inference2 in model.py) this seems to be whilst calling the backbone3d.

I'm assuming of course there isnt a library compatibility issue and i have the right weights downloaded etc for this to work correctly. It sounds like others have been able to run the inference so im curious whether that was down to hardware or not.

Thanks

Tony

Visualizing sample data

Apologies if this is has an obvious answer. I've successfully ran the inference script on the sample scene but I'm struggling to open the .ply file. Opening in ctmviewer throws an error saying the .ply file is invalid. How do I visualize the result?

Question for results

Thank for releasing the code implementation.

I have a question for the results.

Is it the same pretrained weights that you reported in your paper??
Currently, I cannot obtain identical results as listed in the paper, though I used the pretrained weights from your download link.

In the paper,
| AbsRel | AbsDiff | SqRel | RMSE | r1 | r2 | r3 |
| 0.061 | 0.120 | 0.42 | 0.248 | 0.940 | 0.972 | 0.985 |

the results I got,
| AbsRel | AbsDiff | SqRel | RMSE | r1 | r2 | r3 |
| 0.117 | 0.213 | 0.092 | 0.355 | 0.852 | 0.926 | 0.963 |

About ScanNet data format

Hi @zmurez, I wonder if the pose/*.txt are same with the files extracted from ScanNet toolkits (SensorData.py). Now I cannot reproduce your results using the data provided by ScanNet official code. If possible, could you provide an example scene in ScanNet with its scene id?

Train my own data

Hi,I want to use kitti dataset to test your model, but the output of vol_04_tsdf are all 0.9999, could your give some advice about test with other dataset?

besides, I am confused about what you said

" Note that the pretrained models are trained with Z-up metric coordinates and do not generalize to other coordinates (this means that the scale and 2 axes of the orientation ambiguity of SFM must be resolved prior to using the poses)."

How should I do to make sure my test data and pose matrix are right?

Question about depth fusion

Thanks for your great work!

According to your paper, point cloud fusion is more robust to the outliers than TSDF Fusion when fusing depth predictions.

But I fuse depth predictions using point cloud fusion (Poisson Reconstruction):
snapshot00

and TSDF Fusion:
snapshot01

Obviously, TSDF Fusion is much better.

Would you please tell me why you think point cloud fusion is more robust to the outliers than TSDF Fusion?

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.