Giter VIP home page Giter VIP logo

isbnet's Introduction

PWC

PWC

PWC

PWC

Table of contents
  1. Features
  2. Datasets
  3. Installation
  4. Data Preparation
  5. Training and Testing
  6. Quick Demo
  7. Visualization
  8. Acknowledgments
  9. Contacts

ISBNet: a 3D Point Cloud Instance Segmentation Network with Instance-aware Sampling and Box-aware Dynamic Convolution

Tuan Duc Ngo, Binh-Son Hua, Khoi Nguyen
VinAI Research, Vietnam

Abstract: Existing 3D instance segmentation methods are predominant by a bottom-up design: a manually fine-tuned algorithm to group points into clusters followed by a refinement network. Relying on the quality of the clusters, these methods generate susceptible results when (1) nearby objects with the same semantic class are packed together, or (2) large objects with complex shapes. To address these shortcomings, we introduce ISBNet, a novel cluster-free method that represents instances as kernels and decodes instance masks via dynamic convolution. To efficiently generate a high-recall and discriminative kernel set, we propose a simple strategy, named Instance-aware Farthest Point Sampling, to sample candidates and leverage the point aggregation layer adopted from PointNet++ to encode candidate features. Moreover, we show that training 3D instance segmentation in a multi-task learning setting with an additional axis-aligned bounding box prediction head further boosts performance. Our method set new state-of-the-art results on ScanNetV2 (55.9), S3DIS (60.8), and STPLS3D (49.2) in terms of AP and retains fast inference time (237ms per scene on ScanNetV2).

overview

Details of the model architecture and experimental results can be found in our paper:

@inproceedings{ngo2023isbnet,
 author={Tuan Duc Ngo, Binh-Son Hua, Khoi Nguyen},
 booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
 title={ISBNet: a 3D Point Cloud Instance Segmentation Network with Instance-aware Sampling and Box-aware Dynamic Convolution},
 year= {2023}
}

Please CITE our paper whenever this repository is used to help produce published results or incorporated into other software.

Features 📣

  • State-of-the-art performance on ScanNetV2, S3DIS, and STPLS3D.
  • High speed of 237ms per scan on ScanNetV2 dataset.
  • Reproducibility code for both ScanNetV2, S3DIS and STPLS3D datasets.

Datasets 💾

  • ScanNetV2
  • ScanNetV2-200
  • S3DIS
  • STPLS3D

Installation 📝

Please refer to installation guide.

Data Preparation 🔨

Please refer to data preparation.

Training and Testing 🚆

Please refer to training guide.

Quick Demo 🔥

Dataset AP AP_50 Config Checkpoint
ScanNet test 55.9 76.3
ScanNet val (paper) 54.5 73.1
ScanNet val 56.8 73.3 config checkpoint
ScanNet val (lightweight) 50.1 68.9 config checkpoint
Dataset AP AP_50 Config Checkpoint
ScanNet200 val 24.5 32.7 config checkpoint
Dataset AP AP_50 Config Checkpoint
Area 5 56.3 67.5 config checkpoint
Dataset AP AP_50 Config Checkpoint
STPLS3D val 51.2 66.7 config checkpoint

Run evaluation with pre-trained models:

python3 tools/test.py <path_to_config_file> <path_to_pretrain_weight>

Visualization 💻

Please refer to visualization guide. We provide the qualitative results of our method at here

Acknowledgements 👏

This repo is built upon SpConv, DyCo3D, SSTNet, and SoftGroup.

Contacts 📧

If you have any questions or suggestions about this repo, please feel free to contact me ([email protected]).

isbnet's People

Contributors

ngoductuanlhp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

isbnet's Issues

Validation checkpoint's result about S3DIS

Hello, dear author. Thank you for your great work.
When I validated the result on the S3DIS dataset Area 5, I found that the given checkpoint obtain a not good result, all the AP is 0.
Could you please offer the correct checkpoints, Thank you.

How to visualize?

I tried to train S3DIS dataset and visualize it. Tell me how to realize that, PLEASE!

Some problems on visualize stpls3d?

Hello Author!
Your research is excellent and I benefit a lot from it.
I trained my dataset,and the result is excellent! My dataset is a corn plant point cloud and is not as large as stpls3d. After model training, the plant is cut into parts. I want to know how to visualize multiple trained files at the same time so that I can see how the whole corn plant is segmented at the same time. I would also like to know if there is a way to save the displayed split file as a colored point cloud file with annotations for easy viewing?
I look forward to your response and thank you very much for your work.

How to train the checkpoint of my datasets?

Hi authors!
Thank you for releasing this amazing work!
Now, I have my own dataset similar to S3dis, but not the same scene. How can I train my own point cloud dataset and get a checkpoint?

Best wishes!
luna

Training my own dataset, metrics like AP are too low at train all.

Hi, first of all thank you very much for your great contribution in the direction of point cloud segmentation. I processed my own data files according to stpls3d, but my data files are smaller, they are plant point cloud data, so I processed them with both train and val_250m torch.save((coords, colors, sem_labels, instance_labels) , pth_file) saves them as .pth files without chunking them. When training my backbone, I only did 12 epochs and here are the results of my backbone run.
image

But when I do the TRAIN ALL, the result is not very good, the evaluation at the end of the first epoch is too bad as below:
image

And after 12 epochs, the results are not very good, as shown below:
image

Here are my config file settings:
model:
channels: 16
num_blocks: 7
semantic_classes: 2
instance_classes: 2
sem2ins_classes: []
semantic_only: False
semantic_weight: [1.0, 1.0]
with_coords: False
ignore_label: -100
voxel_scale: 50
use_spp_pool: False
filter_bg_thresh: 0.1
iterative_sampling: False
mask_dim_out: 16
instance_head_cfg:
dec_dim: 64
n_sample_pa1: 2048
n_queries: 256
radius_scale: 10
radius: 0.04
neighbor: 16
test_cfg:
x4_split: False
logit_thresh: 0.0
score_thresh: 0.2
npoint_thresh: 10
type_nms: 'matrix'
topk: 100

fixed_modules: ['input_conv', 'unet', 'output_layer', 'semantic_linear', 'offset_linear', 'offset_vertices_linear', 'box_conf_linear']

data:
train:
type: 'plant'
data_root: 'dataset/plant'
prefix: 'train1'
suffix: '.pth'
training: True
repeat: 3
voxel_cfg:
scale: 50
spatial_shape: [128, 512]
max_npoint: 250000
min_npoint: 5000
test:
type: 'plant'
data_root: 'dataset/plant'
prefix: 'val_250m1'
suffix: '.pth'
training: False
voxel_cfg:
scale: 50
spatial_shape: [128, 512]
max_npoint: 250000
min_npoint: 5000

dataloader:
train:
batch_size: 8
num_workers: 8
test:
batch_size: 1
num_workers: 1

optimizer:
type: 'AdamW'
lr: 0.001
weight_decay: 0.0001

save_cfg:
semantic: False
offset: False
instance: True
offset_vertices: False
nmc_clusters: False
object_conditions: False

fp16: True
epochs: 12
step_epoch: 4
save_freq: 4
pretrain: 'work_dirs/plant/isbnet_backbone_plant/exp3/latest.pth'
work_dir: ''

Can you give me some advice please, thank you very much!

KeyError: 'placeholder" in training epoch 259 (set total epoch 500 )

Hi authors:
thank you for your wonderful work. I have run this repo successfully. But when I trained my own dataset , I met an error in training epoch 259 , called " KeyError: 'placeholder" , this error happen in 'tools/train.py' file , line 75 , in train. code 'meter_dicd(k).update(v)'
waiting for your help!
thanks

no module named 'visualizer'

import pyviz3d.visualizer as viz in vis_scannet200.py caused an error named 'no module named visualizer'
How to solve this error?

AssertionError: No instance result - results/pred_instance/scene0011_00.txt.

When I use visualization.py for the scannet200 dataset visualization. An error occurred. The command I used is: python tools/visualization.py --prediction_path results/ --out output/

Traceback (most recent call last):
File "tools/visualization.py", line 606, in
xyz, rgb, boxes = get_coords_color(opt)
File "tools/visualization.py", line 435, in get_coords_color
assert os.path.isfile(instance_file), "No instance result - {}.".format(instance_file)
AssertionError: No instance result - results/pred_instance/scene0011_00.txt.

Any ideas about this? Thanks so much in advance!!!

[pretrained scannet_v2_lightweight] size mismatch: inst_mask_head.2.weight, inst_mask_head.2.bias

Hi authors!
Thank you for releasing this amazing work!

What I did

I'm trying to use the pretrained weight for a quick demo of ScanNet val (lightweight). I've downloaded the pretrained checkpoint, and run the following command:

python3 tools/test.py configs/scannetv2/isbnet_lightweight_scannetv2.yaml dataset/pretrained/head_small_scannetv2_val.pth --out out/scannetv2_lightweight

(for a quick demo, I only load 3 scans instead of all 312 scans in the validation set)

Result

output

However, here's the output:

$ python3 tools/test.py configs/scannetv2/isbnet_lightweight_scannetv2.yaml dataset/pretrained/head_small_scannetv2_val.pth --out out/scannetv2_lightweight
self.mask_dim_out 32 # this is something I added for debugging
weight_nums [1216, 512, 16] # this is something I added for debugging
bias_nums [32, 16, 1] # this is something I added for debugging
 self.num_gen_params 1793 # this is something I added for debugging
2023-08-23 16:07:43,226 - INFO - Load state dict from dataset/pretrained/head_small_scannetv2_val.pth
skip key inst_mask_head.2.weight torch.Size([1281, 64, 1]) torch.Size([1793, 64, 1]) # this is something I added for debugging
skip key inst_mask_head.2.bias torch.Size([1281]) torch.Size([1793]) # this is something I added for debugging
2023-08-23 16:07:43,363 - INFO - removed keys in source state_dict due to size mismatch: inst_mask_head.2.weight, inst_mask_head.2.bias
2023-08-23 16:07:43,364 - INFO - missing keys in source state_dict: inst_mask_head.2.weight, inst_mask_head.2.bias
2023-08-23 16:07:43,364 - INFO - unexpected key in source state_dict: criterion.empty_weight
2023-08-23 16:07:43,366 - INFO - Load test dataset: 3 scans
2023-08-23 16:07:47,343 - INFO - Infer scene 1/3
2023-08-23 16:07:48,432 - INFO - Evaluate instance segmentation

################################################################
what           :      AP  AP_50%  AP_25%      AR  RC_50%  RC_25%
################################################################
cabinet        :   0.000   0.000   0.000   0.000   0.000   0.000
bed            :     nan     nan     nan     nan     nan     nan
chair          :   0.000   0.000   0.000   0.000   0.000   0.000
sofa           :     nan     nan     nan     nan     nan     nan
table          :   0.000   0.000   0.125   0.000   0.000   0.125
door           :   0.000   0.000   0.000   0.000   0.000   0.000
window         :   0.000   0.000   0.000   0.000   0.000   0.000
bookshelf      :     nan     nan     nan     nan     nan     nan
picture        :     nan     nan     nan     nan     nan     nan
counter        :     nan     nan     nan     nan     nan     nan
desk           :     nan     nan     nan     nan     nan     nan
curtain        :     nan     nan     nan     nan     nan     nan
refrigerator   :     nan     nan     nan     nan     nan     nan
shower curtain :     nan     nan     nan     nan     nan     nan
toilet         :   0.000   0.000   0.000   0.000   0.000   0.000
sink           :   0.000   0.000   0.000   0.000   0.000   0.000
bathtub        :   0.000   0.000   0.000   0.000   0.000   0.000
otherfurniture :   0.000   0.000   0.000   0.000   0.000   0.000
----------------------------------------------------------------
average        :   0.000   0.000   0.014   0.000   0.000   0.014
################################################################

2023-08-23 16:07:50,481 - INFO - Average run time: 1.3831
2023-08-23 16:07:50,481 - INFO - Save results

visualization

And here's an visualization result:
image

analyze

I suppose the wrong result is mainly due to the failure to load inst_mask_head.2.weight and inst_mask_head.2.bias. So I print some values to debug. In isbnet/model/isbnet.py, init_dyco(), I print something like:

weight_nums = [(self.mask_dim_out + 3 + 3) * self.mask_dim_out, self.mask_dim_out * (self.mask_dim_out//2), (self.mask_dim_out//2) * 1]
bias_nums = [self.mask_dim_out, (self.mask_dim_out//2), 1]

self.weight_nums = weight_nums
self.bias_nums = bias_nums
self.num_gen_params = sum(weight_nums) + sum(bias_nums) # self.num_gen_params = 1281 #

# NOTE convolution before the condinst take place (convolution num before the generated parameters take place)
inst_mask_head = [
    conv_block(self.instance_head_cfg.dec_dim, self.instance_head_cfg.dec_dim),
    conv_block(self.instance_head_cfg.dec_dim, self.instance_head_cfg.dec_dim),
]

controller_head = nn.Conv1d(self.instance_head_cfg.dec_dim, self.num_gen_params, kernel_size=1)
print('self.mask_dim_out',self.mask_dim_out)
print('weight_nums',weight_nums)
print('bias_nums',bias_nums)
print(' self.num_gen_params', self.num_gen_params)
torch.nn.init.normal_(controller_head.weight, std=0.01)
torch.nn.init.constant_(controller_head.bias, 0)
inst_mask_head.append(controller_head)
self.add_module("inst_mask_head", nn.Sequential(*inst_mask_head))

and the issue is that self.num_gen_params is 1793 instead of 1281 (see the output mentioned above).

Though 1793-1281=512, and weight_nums is of shape [1216, 512, 16], and bias_nums is of shape [32, 16, 1], I'm not sure how to fix this issue. Could you please help? Thank you!!

segmentation fault (core dumped)

Dear author @ngoductuanlhp ,

I use this command to train the model for the stpls3d dataset and load the pre-trained backbone in the config file: python tools/train.py --trainall --exp_name testtest1

However. I meet this problem after running the above command:
2023-08-11 14:39:56,588 - INFO - missing keys in source state_dict: point_aggregator1.mlp_module1.layer0.conv.weight, point_aggregator1.mlp_module1.layer0.bn.bn.weight, point_aggregator1.mlp_module1.layer0.bn.bn.bias, point_aggregator1.mlp_module1.layer0.bn.bn.running_mean, point_aggregator1.mlp_module1.layer0.bn.bn.running_var, point_aggregator1.mlp_module1.layer1.conv.weight, point_aggregator1.mlp_module1.layer1.bn.bn.weight, point_aggregator1.mlp_module1.layer1.bn.bn.bias, point_aggregator1.mlp_module1.layer1.bn.bn.running_mean, point_aggregator1.mlp_module1.layer1.bn.bn.running_var, point_aggregator1.mlp_module2.layer0.conv.weight, point_aggregator1.mlp_module2.layer0.bn.bn.weight, point_aggregator1.mlp_module2.layer0.bn.bn.bias, point_aggregator1.mlp_module2.layer0.bn.bn.running_mean, point_aggregator1.mlp_module2.layer0.bn.bn.running_var, point_aggregator1.mlp_module3.0.conv.weight, point_aggregator1.mlp_module3.0.bn.bn.weight, point_aggregator1.mlp_module3.0.bn.bn.bias, point_aggregator1.mlp_module3.0.bn.bn.running_mean, point_aggregator1.mlp_module3.0.bn.bn.running_var, point_aggregator1.mlp_module3.1.conv.weight, point_aggregator1.mlp_module3.1.bn.bn.weight, point_aggregator1.mlp_module3.1.bn.bn.bias, point_aggregator1.mlp_module3.1.bn.bn.running_mean, point_aggregator1.mlp_module3.1.bn.bn.running_var, point_aggregator2.mlp_module1.layer0.conv.weight, point_aggregator2.mlp_module1.layer0.bn.bn.weight, point_aggregator2.mlp_module1.layer0.bn.bn.bias, point_aggregator2.mlp_module1.layer0.bn.bn.running_mean, point_aggregator2.mlp_module1.layer0.bn.bn.running_var, point_aggregator2.mlp_module1.layer1.conv.weight, point_aggregator2.mlp_module1.layer1.bn.bn.weight, point_aggregator2.mlp_module1.layer1.bn.bn.bias, point_aggregator2.mlp_module1.layer1.bn.bn.running_mean, point_aggregator2.mlp_module1.layer1.bn.bn.running_var, point_aggregator2.mlp_module2.layer0.conv.weight, point_aggregator2.mlp_module2.layer0.bn.bn.weight, point_aggregator2.mlp_module2.layer0.bn.bn.bias, point_aggregator2.mlp_module2.layer0.bn.bn.running_mean, point_aggregator2.mlp_module2.layer0.bn.bn.running_var, point_aggregator2.mlp_module3.0.conv.weight, point_aggregator2.mlp_module3.0.bn.bn.weight, point_aggregator2.mlp_module3.0.bn.bn.bias, point_aggregator2.mlp_module3.0.bn.bn.running_mean, point_aggregator2.mlp_module3.0.bn.bn.running_var, point_aggregator2.mlp_module3.1.conv.weight, point_aggregator2.mlp_module3.1.bn.bn.weight, point_aggregator2.mlp_module3.1.bn.bn.bias, point_aggregator2.mlp_module3.1.bn.bn.running_mean, point_aggregator2.mlp_module3.1.bn.bn.running_var, inst_shared_mlp.layers.0.weight, inst_shared_mlp.layers.1.weight, inst_shared_mlp.layers.1.bias, inst_shared_mlp.layers.1.running_mean, inst_shared_mlp.layers.1.running_var, inst_shared_mlp.layers.3.weight, inst_shared_mlp.layers.3.bias, inst_shared_mlp.layers.4.weight, inst_shared_mlp.layers.4.bias, inst_shared_mlp.layers.4.running_mean, inst_shared_mlp.layers.4.running_var, inst_sem_head.layers.0.weight, inst_sem_head.layers.1.weight, inst_sem_head.layers.1.bias, inst_sem_head.layers.1.running_mean, inst_sem_head.layers.1.running_var, inst_sem_head.layers.3.weight, inst_sem_head.layers.4.weight, inst_sem_head.layers.4.bias, inst_sem_head.layers.4.running_mean, inst_sem_head.layers.4.running_var, inst_sem_head.layers.6.weight, inst_sem_head.layers.6.bias, inst_conf_head.layers.0.weight, inst_conf_head.layers.1.weight, inst_conf_head.layers.1.bias, inst_conf_head.layers.1.running_mean, inst_conf_head.layers.1.running_var, inst_conf_head.layers.3.weight, inst_conf_head.layers.4.weight, inst_conf_head.layers.4.bias, inst_conf_head.layers.4.running_mean, inst_conf_head.layers.4.running_var, inst_conf_head.layers.6.weight, inst_conf_head.layers.6.bias, inst_box_head.layers.0.weight, inst_box_head.layers.1.weight, inst_box_head.layers.1.bias, inst_box_head.layers.1.running_mean, inst_box_head.layers.1.running_var, inst_box_head.layers.3.weight, inst_box_head.layers.4.weight, inst_box_head.layers.4.bias, inst_box_head.layers.4.running_mean, inst_box_head.layers.4.running_var, inst_box_head.layers.6.weight, inst_box_head.layers.6.bias, mask_tower.0.0.weight, mask_tower.0.1.weight, mask_tower.0.1.bias, mask_tower.0.1.running_mean, mask_tower.0.1.running_var, mask_tower.1.0.weight, mask_tower.1.1.weight, mask_tower.1.1.bias, mask_tower.1.1.running_mean, mask_tower.1.1.running_var, mask_tower.2.0.weight, mask_tower.2.1.weight, mask_tower.2.1.bias, mask_tower.2.1.running_mean, mask_tower.2.1.running_var, mask_tower.3.weight, mask_tower.3.bias, inst_mask_head.0.0.weight, inst_mask_head.0.1.weight, inst_mask_head.0.1.bias, inst_mask_head.0.1.running_mean, inst_mask_head.0.1.running_var, inst_mask_head.1.0.weight, inst_mask_head.1.1.weight, inst_mask_head.1.1.bias, inst_mask_head.1.1.running_mean, inst_mask_head.1.1.running_var, inst_mask_head.2.weight, inst_mask_head.2.bias 2023-08-11 14:39:56,589 - INFO - Training [1] 31433 segmentation fault (core dumped) CUDA_VISIBLE_DEVICES=3 python tools/train.py --trainall --exp_name testtest1

Could u please help me to solve this problem, many thanks!

Issue in evaluating STLPS3D dataset

Hi,

I am trying to run the code for inference using STLPS3D, afte running bash prepare_data.sh and
python3 tools/test.py ./configs/stpls3d/isbnet_stpls3d.yaml ./head_stpls3d_val.pth
For some reason it counts it as a custom ds and redirect to custom.py which then complains that the dataset is empty.
image

Any recommendation how to fix that?

Performance improvement gap between the val and test set on ScanNet

Hi, thanks for your great work on 3D instance segmentation. I have a question about the performance on the ScanNet dataset.

I noticed that your results on the test set improved by 3.2% on the AP50 metric compared with the val set results. However, when I tried my own model on the ScanNet benchmark, I found that my val set and test set results are very similar. Do you know why ISBNet performs much better on the test set? I would love to know how to improve my own models.

Looking forward to your reply, thanks in advance!

When test on 'Synthetic_v3_InstanceSegmentation' test dataset, break out Segmentation fault (core dumped) without any more imformation

Hi, I am working to test on 'Synthetic_v3_InstanceSegmentation' test dataset. However, no matter how to split data to small blocks, it awalys come out "Segmentation fault (core dumped)" without any more imformation to fix it. what can I do to reslove [it?]

(isbnet) root@autodl-container-690911b33c-4a0c7e92:~/ISBNet-master# python tools/test.py configs/stpls3d/isbnet_stpls3d.yaml head_stpls3d_val.pth --out result/test
2023-07-16 10:37:20,083 - INFO - Load state dict from head_stpls3d_val.pth
2023-07-16 10:37:20,229 - INFO - unexpected key in source state_dict: criterion.empty_weight
2023-07-16 10:37:20,233 - INFO - Load test dataset: 100 scans
Segmentation fault (core dumped)

About scannetv2 hidden test upload

What else should be done to handle pred_masks after test output before submitting them to the authorities? After I output the masks, the assessment fails all the time

test dataset

Hi, I found that scannet200 did not use the test set but the validation set for testing. When I used the test set for testing, an error was reported that there was no semantic label and instance label. Then there's how I can load my own test set onto the model.

About stpls3d training

Hi,
I get an error when I train on the stpls3d dataset.

File "D:/Instance_Segmentation/ISBNet-master/tools/train.py", line 309, in
main()
File "D:/Instance_Segmentation/ISBNet-master/tools/train.py", line 300, in main
train(epoch, model, optimizer, scheduler, scaler, train_loader, cfg, logger, writer)
File "D:/Instance_Segmentation/ISBNet-master/tools/train.py", line 70, in train
loss, log_vars = model(batch, return_loss=True, epoch=epoch - 1)
File "D:\Anaconda3\envs\tf_to\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "D:\Instance_Segmentation\ISBNet-master\isbnet\model\isbnet.py", line 220, in forward
return self.forward_train(**batch, epoch=epoch)
File "D:\Instance_Segmentation\ISBNet-master\isbnet\util\utils.py", line 172, in wrapper
return func(*new_args, **new_kwargs)
File "D:\Instance_Segmentation\ISBNet-master\isbnet\model\isbnet.py", line 361, in forward_train
voxel_instance_labels, subsample_idxs, instance_cls, instance_box, dc_batch_offsets, batch_size
File "D:\Instance_Segmentation\ISBNet-master\isbnet\model\model_utils.py", line 657, in get_subsample_gt
instance_labels_b = subsample_instance_labels[start:end]
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Process finished with exit code 1

I'm running on a single RTX 4090, even if the batch size is set to 1.
When I try to set use_spp_pool=True, this error will not be displayed, but it will bring a vast GPU memory usage.
Can you give me some advice?
Thanks.
Best

error error

git clone https://github.com/Karbo123/segmentator.git

cd segmentator/csrc
mkdir build && cd build

cmake ..
-DCMAKE_PREFIX_PATH=python -c 'import torch;print(torch.utils.cmake_prefix_path)'
-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
-DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
-DCMAKE_INSTALL_PREFIX=python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'

make && make install

error installing segmentator

Dear author,

When I type in cmake ..\... after mkdir build && cd bulid , the following error occurs:

CMake Error at /usr/local/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:756 (message):
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.
Compiler: /usr/local/cuda-11.3/bin/nvcc
Build flags:
Id flags: --keep;--keep-dir;tmp -v
The output was:
1

Could you please help me solve it, many thanks!

Error happens at Install Segmentator

When I run the command
'cmake ..
-DCMAKE_PREFIX_PATH=python -c 'import torch;print(torch.utils.cmake_prefix_path)'
-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
-DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
-DCMAKE_INSTALL_PREFIX=python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())' '

The error happens:
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /usr/bin/nvcc
CMake Error in /mnt/d/student/Documents/software/wsl/isbnet/ISBNet-master/ISBNet-master/segmentator/csrc/build/CMakeFiles/CMake
Tmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_017f8".

CMake Error in /mnt/d/student/Documents/software/wsl/isbnet/ISBNet-master/ISBNet-master/segmentator/csrc/build/CMakeFiles/CMake
Tmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_017f8".
-- Configuring incomplete, errors occurred!

How do I solve this problem? Thanks in advance!

There were some problems when training your own dataset

Hello author!
Thank you very much for your work, it has benefited me a lot. I changed my own data with reference to stpls3d. And modified the model-related files for training. But the one where the semantic tag starts (either started from 0 or 1) cannot be rendered in training.The problem is shown in the picture.Is there any way you can solve this problem?

微信图片_20230612194935

Demo results of stpls3d lower than expected

I run the demo code
python3 tools/test.py ./configs/stpls3d/isbnet_stpls3d.yaml ./pretrains/stpls3d/head_stpls3d_val.pth
and the result goes:

2023-12-03 06:13:31,107 - INFO - Load state dict from ./pretrains/stpls3d/head_stpls3d_val.pth
2023-12-03 06:13:31,423 - INFO - unexpected key in source state_dict: criterion.empty_weight
2023-12-03 06:13:31,428 - INFO - Load test dataset: 20 scans
2023-12-03 06:13:42,487 - INFO - Infer scene 1/20
2023-12-03 06:13:52,746 - INFO - Infer scene 11/20
2023-12-03 06:14:01,647 - INFO - Evaluate instance segmentation

################################################################
what           :      AP  AP_50%  AP_25%      AR  RC_50%  RC_25%
################################################################
building       :   0.003   0.004   0.006   0.005   0.008   0.011
low vegetation :   0.002   0.004   0.023   0.005   0.009   0.034
med. vegetation:   0.000   0.000   0.000   0.000   0.000   0.000
high vegetation:   0.023   0.035   0.070   0.046   0.066   0.106
vehicle        :   0.028   0.049   0.074   0.046   0.072   0.093
truck          :   0.000   0.000   0.002   0.000   0.000   0.003
aircraft       :   0.000   0.000   0.000   0.000   0.000   0.000
militaryVehicle:   0.000   0.000   0.000   0.000   0.000   0.000
bike           :   0.007   0.020   0.046   0.014   0.036   0.076
motorcycle     :   0.026   0.049   0.079   0.037   0.063   0.085
light pole     :   0.173   0.201   0.234   0.217   0.240   0.262
street sign    :   0.003   0.005   0.005   0.004   0.005   0.005
clutter        :   0.001   0.002   0.004   0.001   0.004   0.005
fence          :   0.000   0.000   0.000   0.000   0.000   0.000
----------------------------------------------------------------
average        :   0.019   0.026   0.039   0.027   0.036   0.049
################################################################

2023-12-03 06:15:57,009 - INFO - Average run time: 1.0293

The val dataset was renamed from "val250m", preprocessed by prepare_data.sh in folder "ISBNet/dataset/stpls3d"
Have I missed something or not do it the right way?
Please help me fix it.

question about the model test

@ngoductuanlhp
Hello, thanks for the great works!

I have some question about the testing a model on stpls3d datasets.
I'm using gpu with 24gb memory.

A cuda out of memory error occurs when running test.py through the setting in config.py. (batch size: 1, num_workers:16, fp16: Ture)
Did you have any idea to slove this problem?
Is it impossible to run with 24gb gpu memory?

Thank you.

About filter_bg_thresh

Hi,
It's excellent work. I found that when running your code, a parameter filter_bg_thresh will cause the output loss to be 0. Effective loss can only be produced if the threshold exceeds this parameter. I don't know if my understanding is correct. Can you tell me what this parameter does?
looking forward to your reply.
Best.

Sufficient equipment required to implement

Hi, thank you for your good model.
Now, I'm trying implemantation for my dataset. So these days, I practice sample datasets (e.g. S3DIS, STLPS3D). I've trained backbone, but I could not train entire model by cuda memory error.
So I tried these approach:

  1. convert from fp16=False to fp16=True
  2. reduced epoch, batch and crop size

But cuda memory error happend every approach.
I guess my equipments are lack of specs. What is the minimum GPU memory required to use full-spec ISBNet?

P.S
I'm using geforce 3060 ti (8GB memory). Are my equipment not enough?

Regards.

checkpoint for ScanNet val seems wrong (only 6M)

Hi authors,
Thank you for this amazing work!

I try to download the checkpoint for ScanNet val, but found in Google Drive that it's only 6M (file name is head_3dyco_scannetv2_val.pth, from link https://drive.google.com/file/d/19FYLM5SzcQSKYR4r9iChauf5cleoXC_H/view).
Still, I try to use it with:
python3 tools/test.py configs/scannetv2/isbnet_scannetv2.yaml dataset/pretrained/head_3dyco_scannetv2_val.pth --out out/scannetv2,
and as expected, it raises the following error:

$ python3 tools/test.py configs/scannetv2/isbnet_scannetv2.yaml dataset/pretrained/head_3dyco_scannetv2_val.pth --out out/scannetv2
2023-08-23 14:38:33,330 - INFO - Load state dict from dataset/pretrained/head_3dyco_scannetv2_val.pth
Traceback (most recent call last):
File "tools/test.py", line 197, in
main()
File "tools/test.py", line 100, in main
load_checkpoint(args.checkpoint, logger, model)
File "/home/yuqiao/ISBNet/isbnet/util/utils.py", line 118, in load_checkpoint
state_dict = torch.load(checkpoint, map_location=lambda storage, loc: storage.cuda(device))
File "/root/miniconda3/envs/jimr_pro/lib/python3.8/site-packages/torch/serialization.py", line 587, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "/root/miniconda3/envs/jimr_pro/lib/python3.8/site-packages/torch/serialization.py", line 242, in init
super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: [enforce fail at inline_container.cc:145] . PytorchStreamReader failed reading zip archive: failed finding central directory

It seems that the wrong .pth file has been uploaded to Google Drive? I wonder if it's possible for you to verify and fix it? Thank you!!

Hidden Test Set

My question is "Is the scale of confidence score important when you check the results on benchmark website?"
If I have 2 pred_masks with confident scores of 0.9 and 0.6, will the evaluation results be different or similar from if I have those 2 pred_masks with confident scores of 0.4 and 0.1 on a different scale?

Thank you very much.

Can you explain to me what the parameter "mask_dim_out: 16" does?

Dear author, I trained my own dataset with your models and got good results, but when I used them for inference, I didn't give the config the value "mask_dim_out: 16" and it tested poorly, when I gave it the value When I give him "mask_dim_out: 16" he tests very well.

Checkpoint of pretrain_scannetv2_benchmark.pth

Could you please share the pre-trained checkpoint of 'pretrains/trainval/pretrain_scannetv2_benchmark.pth' mentioned in the config file isbnet_benchmark_scannetv2.yaml. Thanks a lot!

About stpls3d training error CUDA out of memory

Hello!
Thanks for your excellent work on 3D instance segmentation. When I trained your network on STPLS, I used an NVIDIA A5000 25GB GPU. After training the first epoch, the validation error CUDA out of memory, even with the batch_size set to 1.
Can you give me some advice?
Waiting for your help
Thank you!

S3DIS Data Preparation Error

I got this error as shown image when I tried to run the "prepare_data.sh" for S3DIS dataset. I think the problem came from the data file (auditorium_1.txt), but is there any solution to this problem?

image

Thank you.

RuntimeError: stack expects a non-empty TensorList

Due to the version of GPU, I have to set the batch_size=1, However, it cause an error when training at the epoch 48 out of 120.
'RuntimeError: stack expects a non-empty TensorList'
I am training the ScanNet200 dataset using this network.
Any ideas about this?
Thanks in advance!!!!

Error: Expected more than 1 value per channel when training

I cannot use batch_size more than 1 when training ISBNet using this command 'python3 tools/train.py configs/scannetv2/isbnet_scannetv2.yaml --trainall --exp_name default'. Then this error occurs.
' raise ValueError("Expected more than 1 value per channel when training, got input size {}".format(size))
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 224])'

How to solve this error? Thanks in advance!!!!

About Training Time

Hello! Thank you for your awesome work for 3D instance segmentation. I want to know that how many GPU did you use and how long does it take to train your network on S3DIS. Thank you!

How can I inference on a custom dataset without labels?

Hello author, I have some cloudpoint data but no annotation labels. My data only includes XYZ and RGB values, without semantic labels or instance labels. How can I inference on a custom dataset without labels?

Thank you !

Some instances that lean together are recognized as the same

Hello author, thank you very much for your great contribution on the top of 3D point cloud segmentation, when I am using your model, maybe there is a problem with the parameter setting of my knn algorithm, so when the model is speculated, some two instances which are leaning on one piece will be recognized as the same instance, I would like to know how to solve this kind of problem?
You can see in the image below that the two arrowed leaves are recognized as one instance.
1700796617780

Is this case a problem with the knn parameter settings and how did you solve this problem?

Training ScanNet200 dataset Error

When I was training the ScanNet200 dataset, An error occured at the epoch55 out of 120.

Traceback (most recent call last):
File "tools/train.py", line 332, in
main()
File "tools/train.py", line 323, in main
train(epoch, model, optimizer, scheduler, scaler, train_loader, cfg, logger, writer)
File "tools/train.py", line 80, in train
loss, log_vars = model(batch, return_loss=True, epoch=epoch - 1) # 这个epoch有没有可能会变成-1之类的啊???
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/isbnet.py", line 219, in forward
return self.forward_train(**batch, epoch=epoch)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/util/utils.py", line 172, in wrapper
return func(*new_args, **new_kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/isbnet.py", line 265, in forward_train
feats, coords_float, voxel_coords, spatial_shape, batch_size, p2v_map
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/isbnet.py", line 632, in forward_backbone
output = self.unet(output)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/blocks.py", line 250, in forward
output_decoder = self.u(output_decoder)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/blocks.py", line 250, in forward
output_decoder = self.u(output_decoder)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/blocks.py", line 250, in forward
output_decoder = self.u(output_decoder)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/blocks.py", line 250, in forward
output_decoder = self.u(output_decoder)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/blocks.py", line 250, in forward
output_decoder = self.u(output_decoder)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/d/student/Documents/software/wsl/isbnet/isbnet-master/isbnet-master/isbnet/model/blocks.py", line 249, in forward
output_decoder = self.conv(output)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/spconv/pytorch/modules.py", line 137, in forward
input = module(input)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/spconv/pytorch/conv.py", line 404, in forward
raise e
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/spconv/pytorch/conv.py", line 395, in forward
timer=input._timer)
File "/home/clinton/anaconda3/envs/isbnet/lib/python3.7/site-packages/spconv/pytorch/ops.py", line 465, in get_indice_pairs_implicit_gemm
stream_int=stream)
RuntimeError: /tmp/pip-build-env-a41g0q_q/overlay/lib/python3.7/site-packages/cumm/include/tensorview/cuda/launch.h(53)
N > 0 assert faild. CUDA kernel launch blocks must be positive, but got N= 0

I used bach_size=1, and also avoided OOM during training freezing all BatchNorm layers during training.
Any ideas about that? Thanks so much in advance!

Particularly poor results are obtained when using the model to infer unlabeled data.

Hello Sir, I am using your model for training my plant point cloud dataset, I modified my dataset based on STPLS3D dataset which has only two semantic classes of stems and culms, and I am getting very good results AP_25 even up to 0.98 during the training process and I am exporting the predicted results of the instances in the validation phase and I am getting satisfactory results. However, when I make inference with unlabeled dataset, the results I get don't seem to be satisfactory, do you know what is the reason for this? @ngoductuanlhp Thank you very much for your great contribution to the 3D point cloud instance segmentation!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.