zju3dv/Vox-Fusion

A bug about svo?

zhw-github opened this issue · 2 comments

I found a bug in the third-party library svo, which is loaded through torch.class and called in the program.
However, if multiple classes are defined at the same time, there will be conflicts between classes and classes, and they are not independent.
The details are as follows:
self.svo = torch.classes.svo.Octree()
self.svo.init(256, embed_dim, self.voxel_size)
self.svo2 = torch.classes.svo.Octree()
self.svo2.init(256, 1, self.voxel_size),we define two classes.
But if i insert points,two classes will conflict.
self.svo2.insert(voxels2.cpu().int())
self.svo.insert(voxels.cpu().int())
if run voxels, children, features = self.svo.get_centres_and_children(),the following error will occur.
"""
voxels, children, features = self.svo.get_centres_and_children()
IndexError: select(): index 1236 out of range for tensor of size [1140, 4] at dimension 0
"""
These are two completely different classes, changing one doesn't affect the second, but they are now conflicting.
How to fix it?

Hi,
This is because our current version has some global variables in the implementation, causing multiple octrees conflicts.
We are doing some code refactoring while fixing this bug, but probably won't update for a short time.

According to my understanding, if you are dealing with single scene, there is no need to instantiate multiple classes ?

Thank you for your answer. I discovered it by accident while debugging the code, and there is no clear purpose. I look forward to your code update.