PointRCNN inference issue
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 365
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 1
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D-ML/issues).
- [X] I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).
### My Question
hi. i'm trying to inference PointRCNN model. but problem occured while inference the model
Below is the error:
**code**
```
import os
import open3d.ml as _ml3d
import open3d.ml.torch as ml3d
from open3d.ml.vis import Visualizer, BoundingBox3D, LabelLUT
from tqdm import tqdm
import time
cfg_file = "ml3d/configs/pointrcnn_kitti.yml"
cfg = _ml3d.utils.Config.load_from_file(cfg_file)
model = ml3d.models.PointRCNN(**cfg.model)
cfg.dataset['dataset_path'] = "/home/amlab/KITTI_point"
# cfg.dataset['dataset_path'] = "/home/amlab/vtd_kitti_format"
# cfg.dataset['dataset_path'] = "/home/amlab/os_test"
dataset = ml3d.datasets.KITTI(cfg.dataset.pop('dataset_path', None), **cfg.dataset)
pipeline = ml3d.pipelines.ObjectDetection(model, dataset=dataset, device="gpu", **cfg.pipeline)
# download the weights.
ckpt_folder = "./logs/"
os.makedirs(ckpt_folder, exist_ok=True)
ckpt_path = ckpt_folder + "pointrcnn_kitti_202105071146utc.pth"
# pointpillar_url = "https://storage.googleapis.com/open3d-releases/model-zoo/pointpillars_kitti_202012221652utc.pth"
# if not os.path.exists(ckpt_path):
# cmd = "wget {} -O {}".format(pointpillar_url, ckpt_path)
# os.system(cmd)
# load the parameters.
pipeline.load_ckpt(ckpt_path=ckpt_path)
test_split = dataset.get_split("training")
# print(test_split.__dict__)
vis = Visualizer()
lut = LabelLUT()
for val in sorted(dataset.label_to_names.keys()):
lut.add_label(val, val)
# run inference on a single example.
# returns dict with 'predict_labels' and 'predict_scores'.
boxes = []
data_list = []
for idx in tqdm(range(10)):
data = test_split.get_data(idx)
true_val = data['bounding_boxes']
result = pipeline.run_inference(data)[0]
pred = {
"name": 'KITTI' + '_' + str(idx),
'points': data['point'],
'bounding_boxes': result
}
data_list.append(pred)
true = {
"name": 'KITTI_true' + '_' + str(idx),
'points': data['point'],
'bounding_boxes': true_val
}
data_list.append(true)
vis.visualize(data_list, lut, bounding_boxes=None)
```
and got a issue.
**Error**
```
Traceback (most recent call last):
File "test_main_point_rcnn.py", line 50, in
result = pipeline.run_inference(data)[0]
File "/home/amlab/Open3D-ML_0.14/ml3d/torch/pipelines/object_detection.py", line 71, in run_inference
results = model(data)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amlab/Open3D-ML_0.14/ml3d/torch/models/point_rcnn.py", line 120, in forward
points)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amlab/Open3D-ML_0.14/ml3d/torch/models/point_rcnn.py", line 676, in forward
x) # (B, N, 3), (B, C, N)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amlab/Open3D-ML_0.14/ml3d/torch/modules/pointnet.py", line 95, in forward
li_xyz, li_features = self.SA_modules[i](l_xyz[i], l_features[i])
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amlab/Open3D-ML_0.14/ml3d/torch/modules/pointnet.py", line 143, in forward
new_features) # (B, mlp[-1], npoint, nsample)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/container.py", line 119, in forward
input = module(input)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 399, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/home/amlab/anaconda3/envs/open3d/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 396, in _conv_forward
self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [16, 3, 1, 1], expected input[1, 4, 4096, 16] to have 3 channels, but got 4 channels instead
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.