waxnkw / IETrans-SGG.pytorch

This is the code of ECCV 2022 (Oral) paper "Fine-Grained Scene Graph Generation with Data Transfer".
Other
89 stars 6 forks source link

Error while reproducing #12

Closed jonghakim35 closed 1 year ago

jonghakim35 commented 1 year ago

Hi, thanks for sharing your great work.

However, while reproducing your results, an error occurs. For VG-50 training, after successfully training a supervised model with the command bash cmds/50/motif/predcls/sup/train.sh, an error occurs while executing bash cmds/50/motif/predcls/lt/internal/relabel.sh as follows:

Traceback (most recent call last): File "tools/internal_relabel.py", line 238, in <module> main() File "tools/internal_relabel.py", line 222, in main file_names = train(cfg, args.local_rank, args.distributed, logger) File "tools/internal_relabel.py", line 46, in train model = build_detection_model(cfg) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/modeling/detector/detectors.py", line 10, in build_detection_model return meta_arch(cfg) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/modeling/detector/generalized_rcnn.py", line 31, in __init__ self.roi_heads = build_roi_heads(cfg, self.backbone.out_channels) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/modeling/roi_heads/roi_heads.py", line 89, in build_roi_heads roi_heads.append(("relation", build_roi_relation_head(cfg, in_channels))) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/modeling/roi_heads/relation_head/relation_head.py", line 146, in build_roi_relation_head return ROIRelationHead(cfg, in_channels) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/modeling/roi_heads/relation_head/relation_head.py", line 33, in __init__ self.predictor = make_roi_relation_predictor(cfg, feat_dim) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/modeling/roi_heads/relation_head/roi_relation_predictors.py", line 871, in make_roi_relation_predictor return func(cfg, in_channels) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/modeling/roi_heads/relation_head/roi_relation_predictors.py", line 235, in __init__ statistics = get_dataset_statistics(config) File "/data3/jongha/IETrans-SGG.pytorch/maskrcnn_benchmark/data/build.py", line 48, in get_dataset_statistics dataset = factory(**args) TypeError: __init__() got an unexpected keyword argument 'custom_bbox_path' Killing subprocess 41362 Traceback (most recent call last): File "/home/jongha/.conda/envs/sg/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/jongha/.conda/envs/sg/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/jongha/.conda/envs/sg/lib/python3.8/site-packages/torch/distributed/launch.py", line 340, in <module> main() File "/home/jongha/.conda/envs/sg/lib/python3.8/site-packages/torch/distributed/launch.py", line 326, in main sigkill_handler(signal.SIGTERM, None) # not coming back File "/home/jongha/.conda/envs/sg/lib/python3.8/site-packages/torch/distributed/launch.py", line 301, in sigkill_handler raise subprocess.CalledProcessError(returncode=last_return_code, cmd=cmd) subprocess.CalledProcessError: Command '['/home/jongha/.conda/envs/sg/bin/python', '-u', 'tools/internal_relabel.py', '--local_rank=0', '--config-file', 'configs/wsup-50.yaml', 'DATASETS.TRAIN', '("50DS_VG_VGKB_train",)', 'MODEL.ROI_RELATION_HEAD.USE_GT_BOX', 'True', 'MODEL.ROI_RELATION_HEAD.USE_GT_OBJECT_LABEL', 'True', 'MODEL.ROI_RELATION_HEAD.PREDICTOR', 'MotifPredictor', 'SOLVER.IMS_PER_BATCH', '12', 'TEST.IMS_PER_BATCH', '2', 'DTYPE', 'float16', 'SOLVER.MAX_ITER', '50000', 'SOLVER.VAL_PERIOD', '2000', 'SOLVER.CHECKPOINT_PERIOD', '2000', 'GLOVE_DIR', '/data3/jongha/exps/glove', 'MODEL.PRETRAINED_DETECTOR_CKPT', './maskrcnn_benchmark/pretrained/pretrained_faster_rcnn/model_final.pth', 'OUTPUT_DIR', '/data3/jongha/exps/50/motif/predcls/lt/internal/relabel', 'MODEL.ROI_RELATION_HEAD.NUM_CLASSES', '51', 'SOLVER.PRE_VAL', 'False', 'MODEL.ROI_RELATION_HEAD.PREDICT_USE_BIAS', 'True', 'WSUPERVISE.DATASET', 'InTransDataset', 'EM.MODE', 'E', 'WSUPERVISE.SPECIFIED_DATA_FILE', 'datasets/vg/50/vg_sup_data.pk']' returned non-zero exit status 1. Traceback (most recent call last): File "internal_cut.py", line 19, in <module> l = pickle.load(open(path, "rb")) FileNotFoundError: [Errno 2] No such file or directory: 'em_E.pk'

Is there any way to fix it?

Again, I appreciate sharing your great work. Thanks.

jonghakim35 commented 1 year ago

By the way, I suppressed an error above by simply adding an argument named custom_bbox_path at __init__ method in class InTransDataset in maskrcnn_benchmark/data/datasets/intras_vg.py, so anyway I got the code properly running.

It would be great if you could double-check if this solution would be proper (without any side-effects). Thanks.

waxnkw commented 1 year ago

Thanks so much for your issue! It is my fault. After adding the custom_bbox_path in the normal VGDataset for demo, I forget to check the InTransDataset. Your solution is OK!

jonghakim35 commented 1 year ago

Thanks for the clarification!