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.06k stars 228 forks source link

SGDet on Custom Images can't get the custom_data_info.json correctly? #150

Open leonodelee opened 2 years ago

leonodelee commented 2 years ago

❓ Questions and Help

I follow your code on my custom data, Briefly, I get the custom_data_info.json but can't get the custom_prediction.json. Here are the mian track:

loading word vectors from /data4/glove/glove.6B.200d.pt 2021-12-08 07:16:09,974 maskrcnn_benchmark.data.build INFO: ---------------------------------------------------------------------------------------------------- 2021-12-08 07:16:09,975 maskrcnn_benchmark.data.build INFO: get dataset statistics... 2021-12-08 07:16:09,975 maskrcnn_benchmark.data.build INFO: Loading data statistics from: /data4/Scene-Graph-Benchmark.pytorch/checkpoints/causal-motifs-sgdet/VG_stanford_filtered_with_attribute_train_statistics.cache 2021-12-08 07:16:09,975 maskrcnn_benchmark.data.build INFO: ---------------------------------------------------------------------------------------------------- loading word vectors from /data4/glove/glove.6B.200d.pt background -> background fail on background loading word vectors from /data4/glove/glove.6B.200d.pt background -> background fail on background loading word vectors from /data4/glove/glove.6B.200d.pt background -> background fail on background background -> background fail on background 2021-12-08 07:16:14,275 maskrcnn_benchmark.utils.checkpoint INFO: Loading checkpoint from catalog://ImageNetPretrained/FAIR/20171220/X-101-32x8d 2021-12-08 07:16:14,275 maskrcnn_benchmark.utils.checkpoint INFO: catalog://ImageNetPretrained/FAIR/20171220/X-101-32x8d points to https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/20171220/X-101-32x8d.pkl Downloading: "https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/20171220/X-101-32x8d.pkl" to /home/.torch/models/X-101-32x8d.pkl /home/anaconda3/envs/scene_graph_benchmark/lib/python3.7/site-packages/torch/hub.py:424: UserWarning: torch.hub._download_url_to_file has been renamed to torch.hub.download_url_to_file to be a public API, _download_url_to_file will be removed in after 1.3 release _download_url_to_file will be removed in after 1.3 release')

0%| | 0.00/339M [00:00<?, ?B/s]



until complete 2021-12-08 07:23:13,035 maskrcnn_benchmark.utils.checkpoint INFO: url https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/20171220/X-101-32x8d.pkl cached in /home/.torch/models/X-101-32x8d.pkl 2021-12-08 07:23:13,322 maskrcnn_benchmark.utils.c2_model_loading INFO: Remapping C2 weights



2021-12-08 07:23:13,392 maskrcnn_benchmark.utils.model_serialization INFO: NO-MATCHING of current module: rpn.head.conv.weight of shape (256, 256, 3, 3) =====> /data4/Scene-Graph-Benchmark.pytorch/datasets/custom_data_info.json SAVED ! 2021-12-08 07:29:24,785 maskrcnn_benchmark.inference INFO: Start evaluation on VG_stanford_filtered_with_attribute_test dataset(25119 images). =====> /data4/Scene-Graph-Benchmark.pytorch/datasets/custom_data_info.json SAVED !

0%| | 0/12560 [00:00<?, ?it/s] 0%| | 0/12560 [00:00<?, ?it/s]/data4/Scene-Graph-Benchmark.pytorch/maskrcnn_benchmark/structures/boxlist_ops.py:47: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629403081/work/torch/csrc/utils/python_arg_parser.cpp:766.) (ws >= min_size) & (hs >= min_size) /data4/Scene-Graph-Benchmark.pytorch/maskrcnn_benchmark/structures/boxlist_ops.py:47: UserWarning: This overload of nonzero is deprecated: nonzero() Consider using one of the following signatures instead: nonzero(, bool as_tuple) (Triggered internally at /opt/conda/conda-bld/pytorch_1595629403081/work/torch/csrc/utils/python_arg_parser.cpp:766.) (ws >= min_size) & (hs >= min_size)



until complete

100%|██████████| 12560/12560 [2:59:16<00:00, 1.17it/s] 2021-12-08 10:28:41,551 maskrcnn_benchmark.inference INFO: Total run time: 2:59:16.765582 (0.8564644756246521 s / img per device, on 2 devices) 2021-12-08 10:28:41,551 maskrcnn_benchmark.inference INFO: Model inference time: 2:53:04.057912 (0.8267891167920459 s / img per device, on 2 devices) Traceback (most recent call last): File "/home/anaconda3/envs/scene_graph_benchmark/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/anaconda3/envs/scene_graph_benchmark/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/anaconda3/envs/scene_graph_benchmark/lib/python3.7/site-packages/torch/distributed/launch.py", line 261, in main() File "/home/anaconda3/envs/scene_graph_benchmark/lib/python3.7/site-packages/torch/distributed/launch.py", line 257, in main cmd=cmd) subprocess.CalledProcessError: Command '['/home/anaconda3/envs/scene_graph_benchmark/bin/python', '-u', 'tools/relation_test_net.py', '--local_rank=1', '--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', 'TDE', 'MODEL.ROI_RELATION_HEAD.CAUSAL.FUSION_TYPE', 'sum', 'MODEL.ROI_RELATION_HEAD.CAUSAL.CONTEXT_LAYER', 'motifs', 'TEST.IMS_PER_BATCH', '2', 'DTYPE', 'float16', 'GLOVE_DIR', '/data4/glove', 'MODEL.PRETRAINED_DETECTOR_CKPT', '/data4/Scene-Graph-Benchmark.pytorch/checkpoints/causal-motifs-sgdet', 'OUTPUT_DIR', '/data4/Scene-Graph-Benchmark.pytorch/checkpoints/causal-motifs-sgdet', 'TEST.CUSTUM_EVAL', 'True', 'TEST.CUSTUM_PATH', '/data4/Scene-Graph-Benchmark.pytorch/datasets/textcaps/train_images', 'DETECTED_SGG_DIR', '/data4/Scene-Graph-Benchmark.pytorch/datasets']' died with <Signals.SIGKILL: 9>.


Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.


fun1024 commented 2 years ago

你好,检查下 last_checkpoint 和 config.yml 里的相关路径,应该能解决的

fun1024 commented 2 years ago

能发下你运行时的命令吗?

leonodelee commented 2 years ago

能发下你运行时的命令吗?

CUDA_VISIBLE_DEVICES=2,3 nohup python -m torch.distributed.launch --master_port 12127 --nproc_per_node=2 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 TDE MODEL.ROI_RELATION_HEAD.CAUSAL.FUSION_TYPE sum MODEL.ROI_RELATION_HEAD.CAUSAL.CONTEXT_LAYER motifs TEST.IMS_PER_BATCH 2 DTYPE "float16" GLOVE_DIR /data4/XX/glove MODEL.PRETRAINED_DETECTOR_CKPT /data4/XX/Scene-Graph-Benchmark.pytorch/checkpoints/causal-motifs-sgdet OUTPUT_DIR /data4/XX/Scene-Graph-Benchmark.pytorch/checkpoints/causal-motifs-sgdet TEST.CUSTUM_EVAL True TEST.CUSTUM_PATH /data4/XX/Scene-Graph-Benchmark.pytorch/datasets/textcaps/train_images DETECTED_SGG_DIR /data4/XX/Scene-Graph-Benchmark.pytorch/datasets &

leonodelee commented 2 years ago

能发下你运行时的命令吗?

CUDA_VISIBLE_DEVICES=2,3 nohup python -m torch.distributed.launch --master_port 12127 --nproc_per_node=2 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 TDE MODEL.ROI_RELATION_HEAD.CAUSAL.FUSION_TYPE sum MODEL.ROI_RELATION_HEAD.CAUSAL.CONTEXT_LAYER motifs TEST.IMS_PER_BATCH 2 DTYPE "float16" GLOVE_DIR /data4/XX/glove MODEL.PRETRAINED_DETECTOR_CKPT /data4/XX/Scene-Graph-Benchmark.pytorch/checkpoints/causal-motifs-sgdet OUTPUT_DIR /data4/XX/Scene-Graph-Benchmark.pytorch/checkpoints/causal-motifs-sgdet TEST.CUSTUM_EVAL True TEST.CUSTUM_PATH /data4/XX/Scene-Graph-Benchmark.pytorch/datasets/textcaps/train_images DETECTED_SGG_DIR /data4/XX/Scene-Graph-Benchmark.pytorch/datasets &

好像内存爆满了,而且数据量太大

fun1024 commented 2 years ago

TEST.CUSTUM_PATH 里的图片可以只放几张啊,是放custom images

leonodelee commented 2 years ago

TEST.CUSTUM_PATH 里的图片可以只放几张啊,是放custom images

您好我是想要跑数据集的,能够在哪里改代码使得保存的数据量小一点吗,比如只保留2位小数点

fun1024 commented 2 years ago

TEST.CUSTUM_PATH 里的图片可以只放几张啊,是放custom images

您好我是想要跑数据集的,能够在哪里改代码使得保存的数据量小一点吗,比如只保留2位小数点

你要可视化整个数据集吗?

leonodelee commented 2 years ago

TEST.CUSTUM_PATH 里的图片可以只放几张啊,是放custom images

您好我是想要跑数据集的,能够在哪里改代码使得保存的数据量小一点吗,比如只保留2位小数点

你要可视化整个数据集吗?

想要用作别的方向的用途的

fun1024 commented 2 years ago

TEST.CUSTUM_PATH 里的图片可以只放几张啊,是放custom images

您好我是想要跑数据集的,能够在哪里改代码使得保存的数据量小一点吗,比如只保留2位小数点

你要可视化整个数据集吗?

想要用作别的方向的用途的

可视化整个数据集计算量太大了,实在不行可以试试分批次处理,最后把结果拼接下

leonodelee commented 2 years ago

TEST.CUSTUM_PATH 里的图片可以只放几张啊,是放custom images

您好我是想要跑数据集的,能够在哪里改代码使得保存的数据量小一点吗,比如只保留2位小数点

你要可视化整个数据集吗?

想要用作别的方向的用途的

可视化整个数据集计算量太大了,实在不行可以试试分批次处理,最后把结果拼接下 我观察到bbox_scores分数0.3623834252357483小数点很多,请问在代码哪里改可以只保留3位小数呢 image

我主要是想要抽取图片其中的关系出来