microsoft / scene_graph_benchmark

image scene graph generation benchmark
MIT License
380 stars 86 forks source link

How to extract relation scores #82

Open ForawardStar opened 2 years ago

ForawardStar commented 2 years ago

Hi, wonderful project! Here I wonder how to extract the predicted relation scores for each box. I simply add "relations" to the TEST.TSV_SAVE_SUBSET in config yaml file named "vinvl_x152c4_home.yaml", and luanch the program using the command as follows: python -m torch.distributed.launch --nproc_per_node=8 tools/test_sg_net.py --config-file sgg_configs/vgattr/vinvl_x152c4_home.yaml TEST.IMS_PER_BATCH 64 MODEL.WEIGHT vinvl_vg_x152c4.pth MODEL.ROI_HEADS.NMS_FILTER 1 MODEL.ROI_HEADS.SCORE_THRESH 0.2 DATA_DIR "/data_dir/output_vinVL_VCR_new" OUTPUT_DIR "/output_dir/output_all_new_relation_scores" TEST.IGNORE_BOX_REGRESSION True MODEL.ATTRIBUTE_ON True TEST.OUTPUT_FEATURE True But an error occurred at the end of the process, which is UnboundLocalError: local variable 'relations' referenced before assignment.

error1

Can anyone know how to fix it? Thanks.