ToniRV/NeRF-SLAM

type object 'gtsam.gtsam.Pose3' has no attribute 'identity'

Opened this issue · 24 comments

szgy66 commented

First of all, thank you for publicizing your project.
When I run the command: python. / examples/slam_demo py -- dataset_dir =. / datasets/up/office0 - dataset_name = nerf - buffer = 100 - slam --parallel_run --img_stride=2 --fusion='nerf' --multi_gpu --gui

The following error will occur:

Running with GPUs: 0,1
Running pipeline in parallel mode.
I0105 19:11:41.273782 58239 pipeline_module.py:85] Module: VioSLAM - Spinning.
Traceback (most recent call last):
File "./examples/slam_demo.py", line 200, in
run(args)
File "./examples/slam_demo.py", line 143, in run
slam_module.spin() # visualizer should be the main spin, but pytorch has a memory bug/leak if threaded...
File "/workspace/NeRF-SLAM/./examples/../pipeline/pipeline_module.py", line 88, in spin
self.initialize_module()
File "/workspace/NeRF-SLAM/./examples/../slam/slam_module.py", line 19, in initialize_module
self.slam = VioSLAM(self.name, self.args, self.device)
File "/workspace/NeRF-SLAM/./examples/../slam/vio_slam.py", line 81, in init
world_T_imu_t0, _, _ = initial_state()
File "/workspace/NeRF-SLAM/./examples/../slam/vio_slam.py", line 65, in initial_state
naive_pose = gtsam.Pose3.identity()
AttributeError: type object 'gtsam.gtsam.Pose3' has no attribute 'identity'

I'm running your project on a server without a visual interface, so I guess it doesn't matter. Can you help me with this problem? Thanks!

You can use this fork to recompile NeRF-SLAM. It fixes issues with new version of GTSAM. I did the same and worked for me.

szgy66 commented

You can use this fork to recompile NeRF-SLAM. It fixes issues with new version of GTSAM. I did the same and worked for me.

Hello, when I recompile the relevant file with your fork. appear this error:
CMakeFiles/Makefile2:32332: recipe for target 'python/CMakeFiles/gtsam_py.dir/all' failed
make[1]: *** [python/CMakeFiles/gtsam_py.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

The same error occurred when I compiled the previous version. pass order: "ti go it clone https://github.com/ToniRV/gtsam-1.git" solve it.

Now I find that your fork is an improvement on the original version, mainly cuda version and gtsam.
But there are still problems. How can I solve it? If it is resolved in the same way, I think there will still be problems raised by this issue.

I check my version of gtsam and the commit of branch used is f427b0411. So, could you do git checkout f427b0411 for gtsam? I am also testing the code myself so do not know much. Hope this solves your issue.

Try this.

I met the same problem with you. Has this problem been solved? Thx.

Try this.

I used your gtsam version and recompiled, but still got the same error.

@543630836 If you are getting type object 'gtsam.gtsam.Pose3' has no attribute 'identity' error, then the problem is with NeRF-SLAM not GTSAM.

Try cloning this and follow the install instruction here.

@543630836 If you are getting type object 'gtsam.gtsam.Pose3' has no attribute 'identity' error, then the problem is with NeRF-SLAM not GTSAM.

Try cloning this and follow the install instruction here.

Thanks for your reply.
However, when I run "cmake --build build_ngp --config RelWithDebInfo -j"
The following error will occur:
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/testbed.dir/build.make:118: testbed] Error 1
make[1]: *** [CMakeFiles/Makefile2:204: CMakeFiles/testbed.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX shared library pyngp.cpython-37m-x86_64-linux-gnu.so
[100%] Built target pyngp
make: *** [Makefile:91: all] Error 2

szgy66 commented

@543630836 If you are getting type object 'gtsam.gtsam.Pose3' has no attribute 'identity' error, then the problem is with NeRF-SLAM not GTSAM.

Try cloning this and follow the install instruction here.

Thank you for your advice, I have compiled successfully, there are no gtsam related errors. But when I run demo's command: "./examples/slam_demo.py --dataset_dir=./Datasets/Replica/office0 --dataset_name=nerf --buffer=100 --slam --parallel_run --img_stride=2 --fusion='nerf' --multi_gpu --gui", It has the following error:

Traceback (most recent call last):
File "/opt/conda/envs/NeRF_SLAM/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/opt/conda/envs/NeRF_SLAM/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/workspace/NeRF_SLAM/./examples/../pipeline/pipeline_module.py", line 88, in spin
self.initialize_module()
File "/workspace/NeRF_SLAM/./examples/../datasets/data_module.py", line 37, in initialize_module
self.dataset = NeRFDataset(self.args, self.device)
File "/workspace/NeRF_SLAM/./examples/../datasets/nerf_dataset.py", line 18, in init
self.parse_metadata()
File "/workspace/NeRF_SLAM/./examples/../datasets/nerf_dataset.py", line 39, in parse_metadata
with open(os.path.join(self.dataset_dir, "transforms.json"), 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: './Datasets/Replica/office0/transforms.json'

I downloaded the related data set from README.md, but I did not find the related transforms.json file. Do you have any suggestions. Thanks a lot.

I tried all the methods mentioned above, but the same problem

szgy66 commented

I tried all the methods mentioned above, but the same problem
you can try this :#21 (comment). It does work for me.

@543630836 Make sure you have extracted the dataset in correct folder. The dataset might be extracted to ./datasets rather than ./Datasets.

Try:

./examples/slam_demo.py --dataset_dir=./datasets/Replica/office0 --dataset_name=nerf --buffer=100 --slam --parallel_run --img_stride=2 --fusion='nerf' --multi_gpu --gui
szgy66 commented

@543630836 Make sure you have extracted the dataset in correct folder. The dataset might be extracted to ./datasets rather than ./Datasets.

Try:

./examples/slam_demo.py --dataset_dir=./datasets/Replica/office0 --dataset_name=nerf --buffer=100 --slam --parallel_run --img_stride=2 --fusion='nerf' --multi_gpu --gui

Hello! Did you have run the sample without command:" ./examples/slam_demo.py --dataset_dir=./datasets/nerf-cube-diorama-dataset/room --dataset_name=nerf --buffer=100 --img_stride=1 --fusion='nerf" on server which without visual interface?

@szgy66 I am using x11 forwarding from server for visualization.

Exactly the same issue.

Any progress on this issue? (dont wanna another fork, sorry guys). It was really frustrating that after a long time install process and finally nothing worked. :-(

@ToniRV can you help us?

szgy66 commented

@ToniRV can you help us?

To be clear, following @bkhanal-11 fork works just fine. I guess your git instruction is :"git clone https://github.com/ToniRV/NeRF-SLAM.git --recurse-submodules". Its wrong. You should use: "git clone https://github.com/jrpowers/NeRF-SLAM.git --recurse-submodules". The rest of the operation can follow this.
The git address of the first step must be correct. Hope that can help you.

@ToniRV can you help us?

To be clear, following @bkhanal-11 fork works just fine. I guess your git instruction is :"git clone https://github.com/ToniRV/NeRF-SLAM.git --recurse-submodules". Its wrong. You should use: "git clone https://github.com/jrpowers/NeRF-SLAM.git --recurse-submodules". The rest of the operation can follow this. The git address of the first step must be correct. Hope that can help you.

thanks @szgy66 , just for g++, which version should be changed to? Currently, I am working with <= 11, is that sufficient? Because I got an error while building instant-ngp.

szgy66 commented

@ToniRV can you help us?

To be clear, following @bkhanal-11 fork works just fine. I guess your git instruction is :"git clone https://github.com/ToniRV/NeRF-SLAM.git --recurse-submodules". Its wrong. You should use: "git clone https://github.com/jrpowers/NeRF-SLAM.git --recurse-submodules". The rest of the operation can follow this. The git address of the first step must be correct. Hope that can help you.

thanks @szgy66 , just for g++, which version should be changed to? Currently, I am working with <= 11, is that sufficient? Because I got an error while building instant-ngp.

image

@ToniRV can you help us?

To be clear, following @bkhanal-11 fork works just fine. I guess your git instruction is :"git clone https://github.com/ToniRV/NeRF-SLAM.git --recurse-submodules". Its wrong. You should use: "git clone https://github.com/jrpowers/NeRF-SLAM.git --recurse-submodules". The rest of the operation can follow this. The git address of the first step must be correct. Hope that can help you.

thanks @szgy66 , just for g++, which version should be changed to? Currently, I am working with <= 11, is that sufficient? Because I got an error while building instant-ngp.

image

I meet a problem:ImportError: /home/mei/anaconda3/envs/nerf-slam2/lib/python3.10/site-packages/torch/lib/../../../../libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/mei/python/NeRF-SLAM/build_ngp/pyngp.cpython-310-x86_64-linux-gnu.so) how can I solve this?

@543630836 If you are getting type object 'gtsam.gtsam.Pose3' has no attribute 'identity' error, then the problem is with NeRF-SLAM not GTSAM.

Try cloning this and follow the install instruction here.

Not using NeRF-SLAM, but the error is same