KaihuaTang / Scene-Graph-Benchmark.pytorch

A new codebase for popular Scene Graph Generation methods (2020). Visualization & Scene Graph Extraction on custom images/datasets are provided. It's also a PyTorch implementation of paper “Unbiased Scene Graph Generation from Biased Training CVPR 2020”
MIT License
1.03k stars 228 forks source link

Some error in prediction(SGDet) on custom images. #71

Open Einstone-rose opened 3 years ago

Einstone-rose commented 3 years ago

❓ Questions and Help

When I use the command line following for SGDet: CUDA_VISIBLE_DEVICES=0 python -m torch.distributed.launch --master_port 10027 --nproc_per_node=1 tools/relation_test_net.py --config-file "configs/e2e_relation_X_101_32_8_FPN_1x.yaml" MODEL.ROI_RELATION_HEAD.USE_GT_BOX False MODEL.ROI_RELATION_HEAD.USE_GT_OBJECT_LABEL False MODEL.ROI_RELATION_HEAD.PREDICTOR CausalAnalysisPredictor MODEL.ROI_RELATION_HEAD.CAUSAL.EFFECT_TYPE none MODEL.ROI_RELATION_HEAD.CAUSAL.FUSION_TYPE sum MODEL.ROI_RELATION_HEAD.CAUSAL.CONTEXT_LAYER motifs TEST.IMS_PER_BATCH 1 DTYPE "float16" GLOVE_DIR /home/kaihua/glove MODEL.PRETRAINED_DETECTOR_CKPT /home/kaihua/checkpoints/causal-motifs-sgdet OUTPUT_DIR /home/kaihua/checkpoints/causal-motifs-sgdet TEST.CUSTUM_EVAL True TEST.CUSTUM_PATH /home/kaihua/checkpoints/custom_images DETECTED_SGG_DIR /home/kaihua/checkpoints/your_output_path

(In particular, my custom images is visual genome datasets) It occurs following mistakes, "AttributeError: 'VGDataset' object has no attribute 'img_info', i am very confused. And I go to find the details of visual_genome.py, in 65 line, there is a line "self.img_info = [self.img_info[i] for i in np.where(self.split_mask)[0]]", the use of self.img_info is ealier than the defination of self.img_info. So i don't know what should i do.

Traceback (most recent call last): File "tools/relation_test_net.py", line 112, in main() File "tools/relation_test_net.py", line 94, in main data_loaders_val = make_data_loader(cfg, mode="test", is_distributed=distributed) File "/home/hanyudong/Scene-Graph-Benchmark.pytorch/maskrcnn_benchmark/data/build.py", line 225, in make_data_loader dataset, sampler, aspect_grouping, images_per_gpu, num_iters, start_iter File "/home/hanyudong/Scene-Graph-Benchmark.pytorch/maskrcnn_benchmark/data/build.py", line 140, in make_batch_data_sampler aspect_ratios = _compute_aspect_ratios(dataset) File "/home/hanyudong/Scene-Graph-Benchmark.pytorch/maskrcnn_benchmark/data/build.py", line 128, in _compute_aspect_ratios img_info = dataset.get_img_info(i) File "/home/hanyudong/Scene-Graph-Benchmark.pytorch/maskrcnn_benchmark/data/datasets/visual_genome.py", line 127, in get_img_info return self.img_info[index] AttributeError: 'VGDataset' object has no attribute 'img_info'

KaihuaTang commented 3 years ago

Please refer to https://github.com/KaihuaTang/Scene-Graph-Benchmark.pytorch/issues/69

KaihuaTang commented 3 years ago

Since I'm working on another project, I don't have GPUs to debug. If it works, please tell me. Thank you.