guochengqian/PointNeXt

Runtime Error when training S3DIS with Pointnet backbone.

SantiDiazC opened this issue · 1 comments

Hi, Thank you for your work!

Currently I'm testing the library and successfully able to train the PointNext-xl following the documentation:

CUDA_VISIBLE_DEVICES=0 python examples/segmentation/main.py --cfg cfgs/s3dis/pointnext-xl.yaml

However, when trying to train the Pointnet architecture:

CUDA_VISIBLE_DEVICES=0 python examples/segmentation/main.py --cfg cfgs/s3dis/pointnet.yaml

I got the following error:

Totally 204 samples in train set
[01/19 19:12:48 S3DIS]: length of training dataset: 6120
  0%|                                                                                                                                      | 0/191 [00:06<?, ?it/s]
Traceback (most recent call last):
  File "examples/segmentation/main.py", line 745, in <module>
    main(0, cfg)
  File "examples/segmentation/main.py", line 248, in main
    train_one_epoch(model, train_loader, criterion, optimizer, scheduler, scaler, epoch, total_iter, cfg)
  File "examples/segmentation/main.py", line 363, in train_one_epoch
    logits = model(data)
  File "/home/hri-david/anaconda3/envs/openpoints/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/hri-david/PycharmProjects/Pointnet/PointNeXt/examples/segmentation/../../openpoints/models/segmentation/base_seg.py", line 45, in forward
    p, f = self.encoder.forward_seg_feat(data)
  File "/home/hri-david/PycharmProjects/Pointnet/PointNeXt/examples/segmentation/../../openpoints/models/backbone/pointnet.py", line 170, in forward_seg_feat
    trans = self.stn(x)
  File "/home/hri-david/anaconda3/envs/openpoints/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/hri-david/PycharmProjects/Pointnet/PointNeXt/examples/segmentation/../../openpoints/models/backbone/pointnet.py", line 34, in forward
    x = F.relu(self.bn1(self.conv1(x)))
  File "/home/hri-david/anaconda3/envs/openpoints/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/hri-david/anaconda3/envs/openpoints/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 301, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/home/hri-david/anaconda3/envs/openpoints/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 298, in _conv_forward
    self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [64, 7, 1], expected input[32, 4, 24000] to have 7 channels, but got 4 channels instead

Is there any solution for this? Thank You in advance!

I found the solution by just changing the in_channels: 4 instead of 7 on the pointnet.yaml file.