-
Notifications
You must be signed in to change notification settings - Fork 111
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
AssertionError when idx.shape[1] == k #79
Comments
Hi, |
Hello, thanks so much for your reply. During the above process, I even do not download the KITTI dataset. Why did the code require to use PCN? |
alright, i got the problem. |
Hi, I try transposing data, but I get more errors.
Then I change it to reshape, and get the error below:
The error I got:
|
can you show me the shape of coor_k and coor_q? |
Thanks so much for your reply!
Then I get following:
The below is what I do in tranning:
The below I get:
|
One thing is weird, These are works ;
These are not works and give error : RuntimeError: CUDA out of memory.
These are not works and give error : AssertionErro: rassert idx.shape[1] == k
|
hi, the problem comes from |
Thank u very much for your reply.
The code I just fork from your repo. |
Hi, i update the code for kNN calculation in If the error still exists, please debug and let me know the shape of input and output for kNN. (coor_k, coor_q, idx) Best! |
HI, I get this after running:
Thank u so much! |
Hi, it seems the last issue ( Unexpected shape of
However, i am not sure why this error occurred. |
sure, this is waht i have in colab: |
Hi, a permission is required to visit this colab. |
Hi, I try use a local laptop to implement the code.
s.deterministic : False |
_, idx = knn(coor_k.contiguous(), coor_q.contiguous()) # bs k np |
SORRY to bother you again!
|
so, what's the shape of 'knn_index' in 'https://github.com/yuxumin/PoinTr/blob/master/models/Transformer.py#L32' in your code. Can you make sure you are in the right way to inference the code? (right model on the corresponding dataset) |
This is what I use in the code: https://github.com/Cmput-414/PoinTr/tree/change
|
Sorry that i am not familiar with Google Colab, and can not run the code in your colab.
knn_index should be (bs * k * np), in the origin setting for PCN dataset, I update a pytorch-based knn algorithm, could you can try the new code?
For OOM problem, i think you can reduce the batchsize (just modify the yaml file) |
THANK U SO MUCH!: |
@jackie174, Congrats! |
Hello Xumin, I got this problem, any suggestions?
bash ./scripts/train.sh 0
--config ./cfgs/KITTI_models/PoinTr.yaml
--exp_name example
/content/pointr
/content/pointr
2022-11-04 04:37:20,520 - PoinTr - INFO - Copy the Config file from ./cfgs/KITTI_models/PoinTr.yaml to ./experiments/PoinTr/KITTI_models/example/config.yaml
2022-11-04 04:37:20,520 - PoinTr - INFO - args.config : ./cfgs/KITTI_models/PoinTr.yaml
2022-11-04 04:37:20,520 - PoinTr - INFO - args.launcher : none
2022-11-04 04:37:20,520 - PoinTr - INFO - args.local_rank : 0
2022-11-04 04:37:20,520 - PoinTr - INFO - args.num_workers : 4
2022-11-04 04:37:20,520 - PoinTr - INFO - args.seed : 0
2022-11-04 04:37:20,521 - PoinTr - INFO - args.deterministic : False
2022-11-04 04:37:20,521 - PoinTr - INFO - args.sync_bn : False
2022-11-04 04:37:20,521 - PoinTr - INFO - args.exp_name : example
2022-11-04 04:37:20,521 - PoinTr - INFO - args.start_ckpts : None
2022-11-04 04:37:20,521 - PoinTr - INFO - args.ckpts : None
2022-11-04 04:37:20,521 - PoinTr - INFO - args.val_freq : 1
2022-11-04 04:37:20,521 - PoinTr - INFO - args.resume : False
2022-11-04 04:37:20,521 - PoinTr - INFO - args.test : False
2022-11-04 04:37:20,521 - PoinTr - INFO - args.mode : None
2022-11-04 04:37:20,521 - PoinTr - INFO - args.experiment_path : ./experiments/PoinTr/KITTI_models/example
2022-11-04 04:37:20,521 - PoinTr - INFO - args.tfboard_path : ./experiments/PoinTr/KITTI_models/TFBoard/example
2022-11-04 04:37:20,521 - PoinTr - INFO - args.log_name : PoinTr
2022-11-04 04:37:20,521 - PoinTr - INFO - args.use_gpu : True
2022-11-04 04:37:20,521 - PoinTr - INFO - args.distributed : False
2022-11-04 04:37:20,521 - PoinTr - INFO - config.optimizer = edict()
2022-11-04 04:37:20,521 - PoinTr - INFO - config.optimizer.type : AdamW
2022-11-04 04:37:20,521 - PoinTr - INFO - config.optimizer.kwargs = edict()
2022-11-04 04:37:20,521 - PoinTr - INFO - config.optimizer.kwargs.lr : 0.0001
2022-11-04 04:37:20,522 - PoinTr - INFO - config.optimizer.kwargs.weight_decay : 0.0005
2022-11-04 04:37:20,522 - PoinTr - INFO - config.scheduler = edict()
2022-11-04 04:37:20,522 - PoinTr - INFO - config.scheduler.type : LambdaLR
2022-11-04 04:37:20,522 - PoinTr - INFO - config.scheduler.kwargs = edict()
2022-11-04 04:37:20,522 - PoinTr - INFO - config.scheduler.kwargs.decay_step : 21
2022-11-04 04:37:20,522 - PoinTr - INFO - config.scheduler.kwargs.lr_decay : 0.9
2022-11-04 04:37:20,522 - PoinTr - INFO - config.scheduler.kwargs.lowest_decay : 0.02
2022-11-04 04:37:20,522 - PoinTr - INFO - config.bnmscheduler = edict()
2022-11-04 04:37:20,522 - PoinTr - INFO - config.bnmscheduler.type : Lambda
2022-11-04 04:37:20,522 - PoinTr - INFO - config.bnmscheduler.kwargs = edict()
2022-11-04 04:37:20,522 - PoinTr - INFO - config.bnmscheduler.kwargs.decay_step : 21
2022-11-04 04:37:20,522 - PoinTr - INFO - config.bnmscheduler.kwargs.bn_decay : 0.5
2022-11-04 04:37:20,522 - PoinTr - INFO - config.bnmscheduler.kwargs.bn_momentum : 0.9
2022-11-04 04:37:20,522 - PoinTr - INFO - config.bnmscheduler.kwargs.lowest_decay : 0.01
2022-11-04 04:37:20,522 - PoinTr - INFO - config.dataset = edict()
2022-11-04 04:37:20,522 - PoinTr - INFO - config.dataset.train = edict()
2022-11-04 04:37:20,522 - PoinTr - INFO - config.dataset.train.base = edict()
2022-11-04 04:37:20,522 - PoinTr - INFO - config.dataset.train.base.NAME : PCN
2022-11-04 04:37:20,522 - PoinTr - INFO - config.dataset.train.base.CATEGORY_FILE_PATH : data/PCN/PCN.json
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.base.N_POINTS : 16384
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.base.N_RENDERINGS : 8
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.base.PARTIAL_POINTS_PATH : data/PCN/%s/partial/%s/%s/%02d.pcd
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.base.COMPLETE_POINTS_PATH : data/PCN/%s/complete/%s/%s.pcd
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.base.CARS : True
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.others = edict()
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.others.subset : train
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.train.others.bs : 64
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val = edict()
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base = edict()
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base.NAME : PCN
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base.CATEGORY_FILE_PATH : data/PCN/PCN.json
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base.N_POINTS : 16384
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base.N_RENDERINGS : 8
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base.PARTIAL_POINTS_PATH : data/PCN/%s/partial/%s/%s/%02d.pcd
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base.COMPLETE_POINTS_PATH : data/PCN/%s/complete/%s/%s.pcd
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.base.CARS : True
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.others = edict()
2022-11-04 04:37:20,523 - PoinTr - INFO - config.dataset.val.others.subset : test
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test = edict()
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.base = edict()
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.base.NAME : KITTI
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.base.CATEGORY_FILE_PATH : data/KITTI/KITTI.json
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.base.N_POINTS : 16384
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.base.CLOUD_PATH : data/KITTI/cars/%s.pcd
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.base.BBOX_PATH : data/KITTI/bboxes/%s.txt
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.others = edict()
2022-11-04 04:37:20,524 - PoinTr - INFO - config.dataset.test.others.subset : test
2022-11-04 04:37:20,524 - PoinTr - INFO - config.model = edict()
2022-11-04 04:37:20,524 - PoinTr - INFO - config.model.NAME : PoinTr
2022-11-04 04:37:20,524 - PoinTr - INFO - config.model.num_pred : 14336
2022-11-04 04:37:20,524 - PoinTr - INFO - config.model.num_query : 224
2022-11-04 04:37:20,524 - PoinTr - INFO - config.model.knn_layer : 1
2022-11-04 04:37:20,524 - PoinTr - INFO - config.model.trans_dim : 384
2022-11-04 04:37:20,524 - PoinTr - INFO - config.total_bs : 64
2022-11-04 04:37:20,525 - PoinTr - INFO - config.step_per_update : 1
2022-11-04 04:37:20,525 - PoinTr - INFO - config.max_epoch : 600
2022-11-04 04:37:20,525 - PoinTr - INFO - config.consider_metric : CDL1
2022-11-04 04:37:20,525 - PoinTr - INFO - Distributed training: False
2022-11-04 04:37:20,525 - PoinTr - INFO - Set random seed to 0, deterministic: False
2022-11-04 04:37:20,534 - PCNDATASET - INFO - Collecting files of Taxonomy [ID=02958343, Name=car]
2022-11-04 04:37:20,563 - PCNDATASET - INFO - Complete collecting files of the dataset. Total files: 5677
/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py:477: UserWarning: This DataLoader will create 4 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
cpuset_checked))
2022-11-04 04:37:20,570 - PCNDATASET - INFO - Collecting files of Taxonomy [ID=02958343, Name=car]
2022-11-04 04:37:20,570 - PCNDATASET - INFO - Complete collecting files of the dataset. Total files: 150
2022-11-04 04:37:20,571 - MODEL - INFO - Transformer with knn_layer 1
2022-11-04 04:37:31,629 - PoinTr - INFO - Using Data parallel ...
2022-11-04 04:37:35,690 - PoinTr - INFO - padding while KITTI training
Traceback (most recent call last):
File "main.py", line 68, in
main()
File "main.py", line 64, in main
run_net(args, config, train_writer, val_writer)
File "/content/pointr/tools/runner.py", line 98, in run_net
ret = base_model(partial)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/parallel/data_parallel.py", line 165, in forward
return self.module(*inputs[0], **kwargs[0])
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/pointr/models/PoinTr.py", line 92, in forward
q, coarse_point_cloud = self.base_model(xyz) # B M C and B M 3
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/pointr/models/Transformer.py", line 353, in forward
coor, f = self.grouper(inpc.transpose(1,2).contiguous())
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/pointr/models/dgcnn_group.py", line 87, in forward
f = self.get_graph_feature(coor, f, coor, f)
File "/content/pointr/models/dgcnn_group.py", line 67, in get_graph_feature
assert idx.shape[1] == k
AssertionError
The text was updated successfully, but these errors were encountered: