Code release for "Cut and Learn for Unsupervised Object Detection and Instance Segmentation" and "VideoCutLER: Surprisingly Simple Unsupervised Video Instance Segmentation"
Hi, I'm tying to train my own dataset. actually i am not sure i am in the right process:
step1: I used maskcut to generate presudo mask for my one-classification dataset
step2: follow your approach to registering ImageNet by modifying the "builtin.py" and "builtin_meta.py" files in the "cutler/data/datasets". I have referenced #37 .
step3: revise the IMS_PER_BATCH=1 in the .yaml config to fit my rtx3070. And also revised the TRIAN from ("imagenet_train",) to ("custom_dataset_train",)
Then run train_net.py script, i have no idea how to prohibit eval processing , so missing "coco/annotations/instances_val2017.json" show:
[04/16 11:32:45 fvcore.common.checkpoint]: Saving checkpoint to /home/fusion/PycharmProjects/sata_seg/sata_7/output/model_final.pth
[04/16 11:32:46 d2.utils.events]: eta: 0:00:00 iter: 3 total_loss: 2.724 loss_cls_stage0: 0.2799 loss_box_reg_stage0: 0.1799 loss_cls_stage1: 0.3023 loss_box_reg_stage1: 0.1137 loss_cls_stage2: 0.316 loss_box_reg_stage2: 0.05036 loss_mask: 0.6936 loss_rpn_cls: 0.7057 loss_rpn_loc: 0.02521 time: 0.3287 last_time: 0.3215 data_time: 0.0198 last_data_time: 0.0247 lr: 0.0001525 max_mem: 2495M
[04/16 11:32:46 d2.engine.hooks]: Overall training speed: 2 iterations in 0:00:00 (0.3287 s / it)
[04/16 11:32:46 d2.engine.hooks]: Total training time: 0:00:01 (0:00:00 on hooks)
Traceback (most recent call last):
File "train_net.py", line 171, in
launch(
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/launch.py", line 84, in launch
main_func(args)
File "train_net.py", line 161, in main
return trainer.train()
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 495, in train
super().train(self.start_iter, self.max_iter)
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/train_loop.py", line 165, in train
self.after_train()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/train_loop.py", line 174, in after_train
h.after_train()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/hooks.py", line 561, in after_train
self._do_eval()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/hooks.py", line 529, in _do_eval
results = self._func()
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 464, in test_and_save_results
self._last_eval_results = self.test(self.cfg, self.model)
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 613, in test
data_loader = cls.build_test_loader(cfg, dataset_name)
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 569, in build_test_loader
return build_detection_test_loader(cfg, dataset_name)
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/config/config.py", line 207, in wrapped
explicit_args = _get_args_from_config(from_config, args, *kwargs)
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/config/config.py", line 245, in _get_args_from_config
ret = from_config_func(args, **kwargs)
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/data/build.py", line 466, in _test_loader_from_config
dataset = get_detection_dataset_dicts(
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/data/build.py", line 246, in get_detection_dataset_dicts
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/data/build.py", line 246, in
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/data/catalog.py", line 58, in get
return f()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/data/datasets/coco.py", line 541, in
DatasetCatalog.register(name, lambda: load_coco_json(json_file, image_root, name))
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/data/datasets/coco.py", line 77, in load_coco_json
coco_api = COCO(json_file)
File "/home/fusion/miniconda3/envs/line_detection/lib/python3.8/site-packages/pycocotools/coco.py", line 81, in init
with open(annotation_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/fusion/PycharmProjects/sata_seg/sata_7/coco/annotations/instances_val2017.json'
Q1: Do i have to prepare the instances_val2017.json (i mean generated by my own dataset)? I'm confused cuze i only wanna do the one-classification instance segmentation .
Q2: in the self-training "python tools/get_self_training_ann.py --new-pred /home/fusion/PycharmProjects/sata_7/output/inference/coco_instances_results.json", "inference/coco_instances_results.json" didnt generated too.
Hi, I'm tying to train my own dataset. actually i am not sure i am in the right process:
step1: I used maskcut to generate presudo mask for my one-classification dataset
step2: follow your approach to registering ImageNet by modifying the "builtin.py" and "builtin_meta.py" files in the "cutler/data/datasets". I have referenced #37 .
step3: revise the IMS_PER_BATCH=1 in the .yaml config to fit my rtx3070. And also revised the TRIAN from ("imagenet_train",) to ("custom_dataset_train",)
Then run train_net.py script, i have no idea how to prohibit eval processing , so missing "coco/annotations/instances_val2017.json" show:
[04/16 11:32:45 fvcore.common.checkpoint]: Saving checkpoint to /home/fusion/PycharmProjects/sata_seg/sata_7/output/model_final.pth [04/16 11:32:46 d2.utils.events]: eta: 0:00:00 iter: 3 total_loss: 2.724 loss_cls_stage0: 0.2799 loss_box_reg_stage0: 0.1799 loss_cls_stage1: 0.3023 loss_box_reg_stage1: 0.1137 loss_cls_stage2: 0.316 loss_box_reg_stage2: 0.05036 loss_mask: 0.6936 loss_rpn_cls: 0.7057 loss_rpn_loc: 0.02521 time: 0.3287 last_time: 0.3215 data_time: 0.0198 last_data_time: 0.0247 lr: 0.0001525 max_mem: 2495M [04/16 11:32:46 d2.engine.hooks]: Overall training speed: 2 iterations in 0:00:00 (0.3287 s / it) [04/16 11:32:46 d2.engine.hooks]: Total training time: 0:00:01 (0:00:00 on hooks) Traceback (most recent call last): File "train_net.py", line 171, in
launch(
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/launch.py", line 84, in launch
main_func(args)
File "train_net.py", line 161, in main
return trainer.train()
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 495, in train
super().train(self.start_iter, self.max_iter)
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/train_loop.py", line 165, in train
self.after_train()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/train_loop.py", line 174, in after_train
h.after_train()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/hooks.py", line 561, in after_train
self._do_eval()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/engine/hooks.py", line 529, in _do_eval
results = self._func()
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 464, in test_and_save_results
self._last_eval_results = self.test(self.cfg, self.model)
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 613, in test
data_loader = cls.build_test_loader(cfg, dataset_name)
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/engine/defaults.py", line 569, in build_test_loader
return build_detection_test_loader(cfg, dataset_name)
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/config/config.py", line 207, in wrapped
explicit_args = _get_args_from_config(from_config, args, *kwargs)
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/config/config.py", line 245, in _get_args_from_config
ret = from_config_func(args, **kwargs)
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/data/build.py", line 466, in _test_loader_from_config
dataset = get_detection_dataset_dicts(
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/data/build.py", line 246, in get_detection_dataset_dicts
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
File "/home/fusion/PycharmProjects/sata_seg/CutLER/cutler/data/build.py", line 246, in
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/data/catalog.py", line 58, in get
return f()
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/data/datasets/coco.py", line 541, in
DatasetCatalog.register(name, lambda: load_coco_json(json_file, image_root, name))
File "/home/fusion/PycharmProjects/sata_seg/detectron2/detectron2/data/datasets/coco.py", line 77, in load_coco_json
coco_api = COCO(json_file)
File "/home/fusion/miniconda3/envs/line_detection/lib/python3.8/site-packages/pycocotools/coco.py", line 81, in init
with open(annotation_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/fusion/PycharmProjects/sata_seg/sata_7/coco/annotations/instances_val2017.json'
Q1: Do i have to prepare the instances_val2017.json (i mean generated by my own dataset)? I'm confused cuze i only wanna do the one-classification instance segmentation .
Q2: in the self-training "python tools/get_self_training_ann.py --new-pred /home/fusion/PycharmProjects/sata_7/output/inference/coco_instances_results.json", "inference/coco_instances_results.json" didnt generated too.
Can u pls tell me how can i do ? thanx~