Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertion error when validating #11

Open
yxchng opened this issue May 16, 2024 · 6 comments
Open

assertion error when validating #11

yxchng opened this issue May 16, 2024 · 6 comments

Comments

@yxchng
Copy link

yxchng commented May 16, 2024

File "/home/user/conda/envs/pointmamba/lib/python3.10/site-packages/ocnn/octree/points.py", line 59, in check_input
    assert self.labels.dim() == 2
@Aristo23333
Copy link
Collaborator

Aristo23333 commented May 18, 2024

File "/home/user/conda/envs/pointmamba/lib/python3.10/site-packages/ocnn/octree/points.py", line 59, in check_input
    assert self.labels.dim() == 2

Sorry since I haven't encountered this issue, so I don't understand the specific reason for this error. You could try to check and provide the code and instructions you use, especially the parts of the main code that are corresponding to the error.

@xuefanliu
Copy link

File "/home/user/conda/envs/pointmamba/lib/python3.10/site-packages/ocnn/octree/points.py", line 59, in check_input
    assert self.labels.dim() == 2

Sorry since I haven't encountered this issue, so I don't understand the specific reason for this error. You could try to check and provide the code and instructions you use, especially the parts of the main code that are corresponding to the error.

Hi authors! I also encounter this issue.

Traceback (most recent call last):
  File "/home/lxf/Workspace/Science/PointMamba/segmentation.py", line 184, in <module>
    SegSolver.main()
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/thsolver/solver.py", line 433, in main
    cls.worker(0, FLAGS)
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/thsolver/solver.py", line 422, in worker
    the_solver.run()
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/thsolver/solver.py", line 397, in run
    eval('self.%s()' % self.FLAGS.SOLVER.run)
  File "<string>", line 1, in <module>
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/thsolver/solver.py", line 320, in train
    self.train_epoch(epoch)
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/thsolver/solver.py", line 149, in train_epoch
    batch = next(self.train_iter)
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
    data = self._next_data()
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data
    return self._process_data(data)
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
    data.reraise()
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise
    raise exception
AssertionError: Caught AssertionError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/thsolver/dataset.py", line 44, in __getitem__
    output = self.transform(sample, idx)    # data augmentation + build octree
  File "/home/lxf/Workspace/Science/PointMamba/datasets/scannet.py", line 142, in __call__
    points = Points(torch.from_numpy(xyz), torch.from_numpy(sample['normals']),
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/ocnn/octree/points.py", line 45, in __init__
    self.check_input()
  File "/home/lxf/anaconda3/envs/pointmamba/lib/python3.10/site-packages/ocnn/octree/points.py", line 59, in check_input
    assert self.labels.dim() == 2
AssertionError

It seems like there's an issue with code in scannet.py

 points = Points(torch.from_numpy(xyz), torch.from_numpy(sample['normals']),
                    torch.from_numpy(color), torch.from_numpy(sample['labels']))

and in ocnn/octree/points.py

    if self.labels is not None:
      assert self.labels.dim() == 2
      assert self.labels.size(0) == self.points.size(0)

I print labels shape and get: Labels shape: torch.Size([237360]). Is this correct shape of labels?
And why does OCNN require the dimension of labels to be 2?

@Aristo23333
Copy link
Collaborator

Aristo23333 commented May 28, 2024 via email

@yxchng
Copy link
Author

yxchng commented May 28, 2024

what is the version of your ocnn? current version has assertion, https://github.com/octree-nn/ocnn-pytorch/blob/master/ocnn/octree/points.py#L59

@xuefanliu
Copy link

Hello! I check out the dimension of my point label, it is actually the dimension is one.And in my ocnn/octree/points.py there isn't the dimension assertion. I will attach my dimension results as well as the points.py

Hi authors! Thanks for your reply! I change the OCNN version to 2.2.0 and solve the issue. Perhaps the OCNN version can be specified in requirements.txt so that the dimension of labels does not need to be changed.

@Aristo23333
Copy link
Collaborator

Aristo23333 commented May 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants