-
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
About the panoptic custom dataset training #114
Comments
同问,解决了吗? |
Hello, when I am training with panoptic segmentation, I followed the instructions on https://github.com/cocodataset/panopticapi/blob/master/panoptic_coco_categories.json to convert labelme to coco format, and I have also completed the dataset registration. However, during training, I keep encountering the following error:
[08/08 10:46:48 maskdino.data.dataset_mappers.coco_panoptic_new_baseline_dataset_mapper]: [COCOPanopticNewBaselineDatasetMapper] Full TransformGens used in training: [RandomFlip(), ResizeScale(min_scale=0.1, max_scale=2.0, target_height=64, target_width=64), FixedSizeCrop(crop_size=(64, 64))]
WARNING [08/08 10:46:49 d2.data.datasets.coco]:
Category ids in annotations are not in [1, #categories]! We'll apply a mapping for you.
[08/08 10:46:49 d2.data.datasets.coco]: Loaded 779 images in COCO format from D:\MaskDINO-main\MaskDINO-main\data\panotic_pathlearning\train\annotations\annotations.json
WARNING [08/08 10:46:49 d2.data.datasets.coco]: Filtered out 124 instances without valid segmentation. There might be issues in your dataset generation process. Please check https://detectron2.readthedocs.io/en/latest/tutorials/datasets.html carefully
[08/08 10:46:49 d2.data.build]: Removed 1 images with no usable annotations. 778 images left.
[08/08 10:46:49 d2.data.build]: Distribution of instances among all 7 categories:
File "D:\MaskDINO-main\MaskDINO-main\detectron2\engine\defaults.py", line 498, in run_step
self._trainer.run_step()
File "D:\MaskDINO-main\MaskDINO-main\detectron2\engine\train_loop.py", line 494, in run_step
loss_dict = self.model(data)
File "D:\anaconda3\envs\maskdino\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\maskdino.py", line 268, in forward
outputs, mask_dict = self.sem_seg_head(features, targets=targets)
File "D:\anaconda3\envs\maskdino\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\modeling\meta_arch\maskdino_head.py", line 75, in forward
return self.layers(features, mask,targets=targets)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\modeling\meta_arch\maskdino_head.py", line 80, in layers
predictions = self.predictor(multi_scale_features, mask_features, mask, targets=targets)
File "D:\anaconda3\envs\maskdino\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\modeling\transformer_decoder\maskdino_decoder.py", line 448, in forward
assert targets is not None
AssertionError
[08/08 10:46:55 d2.engine.hooks]: Total training time: 0:00:04 (0:00:00 on hooks)
[08/08 10:46:55 d2.utils.events]: iter: 0 lr: N/A max_mem: 1395M
Traceback (most recent call last):
File "D:\MaskDINO-main\MaskDINO-main\567.py", line 411, in
launch(
File "D:\MaskDINO-main\MaskDINO-main\detectron2\engine\launch.py", line 84, in launch
main_func(*args)
File "D:\MaskDINO-main\MaskDINO-main\567.py", line 398, in main
return trainer.train()
File "D:\MaskDINO-main\MaskDINO-main\detectron2\engine\defaults.py", line 488, in train
super().train(self.start_iter, self.max_iter)
File "D:\MaskDINO-main\MaskDINO-main\detectron2\engine\train_loop.py", line 155, in train
self.run_step()
File "D:\MaskDINO-main\MaskDINO-main\detectron2\engine\defaults.py", line 498, in run_step
self._trainer.run_step()
File "D:\MaskDINO-main\MaskDINO-main\detectron2\engine\train_loop.py", line 494, in run_step
loss_dict = self.model(data)
File "D:\anaconda3\envs\maskdino\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\maskdino.py", line 268, in forward
outputs, mask_dict = self.sem_seg_head(features, targets=targets)
File "D:\anaconda3\envs\maskdino\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\modeling\meta_arch\maskdino_head.py", line 75, in forward
return self.layers(features, mask,targets=targets)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\modeling\meta_arch\maskdino_head.py", line 80, in layers
predictions = self.predictor(multi_scale_features, mask_features, mask, targets=targets)
File "D:\anaconda3\envs\maskdino\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\MaskDINO-main\MaskDINO-main\maskdino\modeling\transformer_decoder\maskdino_decoder.py", line 448, in forward
assert targets is not None
AssertionError
In maskdino.py, my batched_inputs does not have instances, but I tried adding them without success. It still goes into the target = None else branch. How can I fix my code?
The text was updated successfully, but these errors were encountered: