Scene-Graph-Benchmark.pytorch icon indicating copy to clipboard operation
Scene-Graph-Benchmark.pytorch copied to clipboard

Custom image problem

Open adidasnike90 opened this issue 5 years ago • 10 comments

❓ 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

adidasnike90 avatar Jul 09 '20 04:07 adidasnike90

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

KaihuaTang avatar Jul 09 '20 04:07 KaihuaTang

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 avatar Jul 09 '20 05:07 adidasnike90

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

adidasnike90 avatar Jul 09 '20 05:07 adidasnike90

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.

KaihuaTang avatar Jul 09 '20 05:07 KaihuaTang

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

adidasnike90 avatar Jul 09 '20 05:07 adidasnike90

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

KaihuaTang avatar Jul 09 '20 06:07 KaihuaTang

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.

sak-18 avatar Jul 13 '20 11:07 sak-18

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)

njucckevin avatar Apr 21 '21 02:04 njucckevin

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

Sonaliam avatar Nov 17 '21 18:11 Sonaliam

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

leonodelee avatar Dec 09 '21 04:12 leonodelee