I tried to train the model from scratch using both the provided dataset and processed data following the instructions. But I met the following error.
`[06/13 16:27:47 d2.data.datasets.coco]: Loaded 5436 images in COCO format from /workspace/ROCA/dataset/Data/Dataset/scan2cad_instances_val.json
[06/13 16:27:47 d2.data.common]: Serializing 5436 elements to byte tensors and concatenating them all ...
[06/13 16:27:47 d2.data.common]: Serialized dataset takes 11.65 MiB
[06/13 16:27:54 d2.evaluation.evaluator]: Start inference on 5436 images
[06/13 16:27:55 d2.evaluation.evaluator]: Inference done 11/5436. 0.0710 s / img. ETA=0:07:35
[06/13 16:28:00 d2.evaluation.evaluator]: Inference done 72/5436. 0.0697 s / img. ETA=0:07:21
[06/13 16:28:05 d2.evaluation.evaluator]: Inference done 134/5436. 0.0693 s / img. ETA=0:07:13
[06/13 16:28:10 d2.evaluation.evaluator]: Inference done 199/5436. 0.0683 s / img. ETA=0:07:01
[06/13 16:28:15 d2.evaluation.evaluator]: Inference done 263/5436. 0.0681 s / img. ETA=0:06:54
[06/13 16:28:20 d2.evaluation.evaluator]: Inference done 326/5436. 0.0681 s / img. ETA=0:06:50
[06/13 16:28:25 d2.evaluation.evaluator]: Inference done 390/5436. 0.0679 s / img. ETA=0:06:43
[06/13 16:28:30 d2.evaluation.evaluator]: Inference done 446/5436. 0.0691 s / img. ETA=0:06:46
ERROR [06/13 16:28:34 d2.engine.train_loop]: Exception during training:
Traceback (most recent call last):
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_ops.py", line 162, in voxelize_nocs
volumes = add_pointclouds_to_volumes(points, volumes)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/pytorch3d/ops/points_to_volumes.py", line 275, in add_pointclouds_to_volumes
raise ValueError("'pointclouds' have to have their 'features' defined.")
ValueError: 'pointclouds' have to have their 'features' defined.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 135, in train
self.after_step()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 165, in after_step
h.after_step()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/hooks.py", line 353, in after_step
self._do_eval()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/hooks.py", line 328, in _do_eval
results = self._func()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 366, in test_and_save_results
self._last_eval_results = self.test(self.cfg, self.model)
File "/workspace/ROCA/network/roca/engine/trainer.py", line 180, in test
results = super().test(cfg, model, evaluators)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 534, in test
results_i = inference_on_dataset(model, data_loader, evaluator)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/evaluation/evaluator.py", line 141, in inference_on_dataset
outputs = model(inputs)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/meta_arch/meta_arch.py", line 40, in forward
return self.inference(batched_inputs)
File "/workspace/ROCA/network/roca/modeling/meta_arch/meta_arch.py", line 124, in inference
results, extra_outputs = self.roi_heads(
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/roi_heads/roi_heads.py", line 132, in forward
pred_instances, alignment_outputs = self._forward_alignment(
File "/workspace/ROCA/network/roca/modeling/roi_heads/roi_heads.py", line 180, in _forward_alignment
return self._forward_alignment_inference(
File "/workspace/ROCA/network/roca/modeling/roi_heads/roi_heads.py", line 282, in _forward_alignment_inference
predictions, extra_outputs = self.alignment_head(
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/alignment_head/alignment_head.py", line 137, in forward
return self.forward_inference(*args, **kwargs)
File "/workspace/ROCA/network/roca/modeling/alignment_head/alignment_head.py", line 333, in forward_inference
predictions, extra_outputs = self._forward_retrieval_inference(
File "/workspace/ROCA/network/roca/modeling/alignment_head/alignment_head.py", line 803, in _forward_retrieval_inference
cad_ids, pred_indices = self.retrieval_head(
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_head.py", line 201, in forward
return self._embedding_lookup(
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_head.py", line 353, in _embedding_lookup
noc_embeds = self.embed_nocs(shape_code, noc_points, pred_masks)
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_ops.py", line 165, in voxelize_nocs
assert len(feats) == 0
AssertionError
[06/13 16:28:34 d2.engine.hooks]: Overall training speed: 7497 iterations in 1:56:25 (0.9318 s / it)
[06/13 16:28:34 d2.engine.hooks]: Total training time: 2:18:02 (0:21:37 on hooks)
[06/13 16:28:34 d2.utils.events]: eta: 18:51:20 iter: 7499 total_loss: 5.823 loss_cls: 0.3354 loss_box_reg: 0.482
3 loss_image_depth: 0.3101 loss_mask: 0.3888 loss_mask_iou: 0.3305 loss_roi_depth: 0.2764 loss_mean_depth: 0.2694
loss_scale: 0.3106 loss_depth_min: 0.04275 loss_depth_max: 0.05285 loss_trans: 0.4288 loss_noc: 0.9828 loss_pro
c: 0.5804 loss_trans_proc: 0.3947 loss_noc_comp: 0.1564 loss_triplet: 0.2907 loss_rpn_cls: 0.03125 loss_rpn_loc:
0.01378 time: 0.9317 data_time: 0.0259 lr: 0.001 max_mem: 4627M
Traceback (most recent call last):
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_ops.py", line 162, in voxelize_nocs
volumes = add_pointclouds_to_volumes(points, volumes)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/pytorch3d/ops/points_to_volumes.py", line 275, in add_pointclouds_to_volumes
raise ValueError("'pointclouds' have to have their 'features' defined.")
ValueError: 'pointclouds' have to have their 'features' defined.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 175, in
main(parse_args())
File "main.py", line 171, in main
train_or_eval(args, cfg)
File "main.py", line 164, in train_or_eval
trainer.train()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 413, in train
super().train(self.start_iter, self.max_iter)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 135, in train
self.after_step()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 165, in after_step
h.after_step()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/hooks.py", line 353, in after_step
self._do_eval()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/hooks.py", line 328, in _do_eval
results = self._func()
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 366, in test_and_save_results
self._last_eval_results = self.test(self.cfg, self.model)
File "/workspace/ROCA/network/roca/engine/trainer.py", line 180, in test
results = super().test(cfg, model, evaluators)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 534, in test
results_i = inference_on_dataset(model, data_loader, evaluator)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/detectron2/evaluation/evaluator.py", line 141, in inference_on_dataset
outputs = model(inputs)
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/meta_arch/meta_arch.py", line 40, in forward
return self.inference(batched_inputs)
File "/workspace/ROCA/network/roca/modeling/meta_arch/meta_arch.py", line 124, in inference
results, extra_outputs = self.roi_heads(
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/roi_heads/roi_heads.py", line 132, in forward
pred_instances, alignment_outputs = self._forward_alignment(
File "/workspace/ROCA/network/roca/modeling/roi_heads/roi_heads.py", line 180, in _forward_alignment
return self._forward_alignment_inference(
File "/workspace/ROCA/network/roca/modeling/roi_heads/roi_heads.py", line 282, in _forward_alignment_inference
predictions, extra_outputs = self.alignment_head(
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/alignment_head/alignment_head.py", line 137, in forward
return self.forward_inference(*args, **kwargs)
File "/workspace/ROCA/network/roca/modeling/alignment_head/alignment_head.py", line 333, in forward_inference
predictions, extra_outputs = self._forward_retrieval_inference(
File "/workspace/ROCA/network/roca/modeling/alignment_head/alignment_head.py", line 803, in _forward_retrieval_inference
cad_ids, pred_indices = self.retrieval_head(
File "/root/anaconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_head.py", line 201, in forward
return self._embedding_lookup(
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_head.py", line 353, in _embedding_lookup
noc_embeds = self.embed_nocs(shape_code, noc_points, pred_masks)
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_head.py", line 226, in embed_nocs
noc_points = voxelize_nocs(grid_to_point_list(noc_points, mask))
File "/workspace/ROCA/network/roca/modeling/retrieval_head/retrieval_ops.py", line 165, in voxelize_nocs
assert len(feats) == 0
AssertionError
`
I am using pytorch3d 0.6.2, pytorch 1.7.0