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.07k stars 229 forks source link

Custom image problem #54

Open adidasnike90 opened 4 years ago

adidasnike90 commented 4 years ago

❓ Questions and Help

Dear Kaihua, Thank you for your great work! I am trying to predict a custom image use your example instruction. Even I changed all your /home/kaihua with mine /home/frank, it seems the data loader still finds pretrained model from /home/kaihua/checkpoints/... Is there any other config files need to be modified?

Below is the log.

Thanks, Fang

2020-07-08 23:42:25,701 maskrcnn_benchmark.data.build INFO: ---------------------------------------------------------------------------------------------------- 2020-07-08 23:42:25,702 maskrcnn_benchmark.data.build INFO: get dataset statistics... 2020-07-08 23:42:25,702 maskrcnn_benchmark.data.build INFO: Loading data statistics from: /home/frank/checkpoints/motif-sgdet-exmp/VG_stanford_filtered_with_attribute_train_statistics.cache 2020-07-08 23:42:25,702 maskrcnn_benchmark.data.build INFO: ---------------------------------------------------------------------------------------------------- loading word vectors from /home/frank/glove/glove.6B.200d.pt background -> background fail on background loading word vectors from /home/frank/glove/glove.6B.200d.pt background -> background fail on background 2020-07-08 23:42:27,738 maskrcnn_benchmark.utils.checkpoint INFO: Loading checkpoint from /home/kaihua/checkpoints/upload_causal_motif_sgdet/model_0028000.pth

KaihuaTang commented 4 years ago

both OUTPUT_DIR and MODEL.PRETRAINED_DETECTOR_CKPT need to be set to the path of your own model

adidasnike90 commented 4 years ago

Thank you for the quick reply! I found the problem just now. It is because the previous checkpoint file came along with the pretrained model.

adidasnike90 commented 4 years ago

But now I got another subprocess.CalledProcessError (see attached log file). It seems like GPU out of memory, but maybe a different configuration would solve. My task is only to use pretrained model to detect relationship between objects. Could you please help me figure out the problem? Thank you so much!

log.txt

KaihuaTang commented 4 years ago

it seems like you didn't provide a valid pretrained model, but it shouldn't cause subprocess.CalledProcessError. sorry, I'm not sure why it happens.

adidasnike90 commented 4 years ago

I just killed the gnome process, free some gpu memory, then it works! That means I do need to use my lab's machine (hard due to the pandemic). Thank you again for your reply and your great project! I've been trying a lot of projects, yours is the most user friendly and elegant coded! I will cite your work in my paper.

Thanks, Fang

KaihuaTang commented 4 years ago

You are welcome, I'm glad I can help.

sak-18 commented 4 years ago

Thank you for the quick reply! I found the problem just now. It is because the previous checkpoint file came along with the pretrained model.

@adidasnike90 @KaihuaTang can someone elaborate on how the problem was solved? Ran into the same problem. Though I have'nt put the models under "/home/username/checkpoints" but at a different location and while running mentioned the correct path for OUTPUT_DIR and MODEL.PRETRAINED_DETECTOR_CKPT. Edit: Solved. Removed the "last_checkpoint" file from the unzipped pretrained model directory which was causing trouble.

njucckevin commented 3 years ago

For me, I want to use the checkpoint provided by author (the unzip upload_causal_motif_sgdet file), I need to set MODEL.PRETRAINED_DETECTOR_CKPT and OUTPUT_DIR the correct file path, for example MODEL.PRETRAINED_DETECTOR_CKPT xxx/Scene-Graph-Benchmark/checkpoints/upload_causal_motif_sgdet OUTPUT_DIR xxx/Scene-Graph-Benchmark/checkpoints/upload_causal_motif_sgdet, and modify the "last_checkpoint" file with correct path, but not remove it (which can not load pretrained model)

Sonaliam commented 2 years ago

Please provide link for downloading causal-motifs-sgdet-exmp checkpoints.

leonodelee commented 2 years ago

Have you solved this issue. subprocess.CalledProcessError: Command '['/home/XX/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/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']' 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