CSAILVision / semantic-segmentation-pytorch

Pytorch implementation for Semantic Segmentation/Scene Parsing on MIT ADE20K dataset
http://sceneparsing.csail.mit.edu/
BSD 3-Clause "New" or "Revised" License
4.96k stars 1.1k forks source link

Test HRNet pretrained model with own pictures #225

Closed KowalskiWang closed 4 years ago

KowalskiWang commented 4 years ago

Did anyone successfully test the trained HRNet model with own picture? How to put checkpoints to test own images? I tried python3 -u test.py --imgs test_img/test_1.jpg --gpu 0 --cfg config/ade20k-hrnetv2.yaml It returns [2020-04-24 22:52:28,556 INFO test.py line 172 17146] Loaded configuration file config/ade20k-hrnetv2.yaml [2020-04-24 22:52:28,556 INFO test.py line 173 17146] Running with config: DATASET: imgMaxSize: 1000 imgSizes: (300, 375, 450, 525, 600) list_train: ./data/training.odgt list_val: ./data/validation.odgt num_class: 150 padding_constant: 32 random_flip: True root_dataset: ./data/ segm_downsampling_rate: 4 DIR: ckpt/ade20k-hrnetv2-c1 MODEL: arch_decoder: c1 arch_encoder: hrnetv2 fc_dim: 720 weights_decoder: weights_encoder: TEST: batch_size: 1 checkpoint: epoch_30.pth result: ./ TRAIN: batch_size_per_gpu: 2 beta1: 0.9 deep_sup_scale: 0.4 disp_iter: 20 epoch_iters: 5000 fix_bn: False lr_decoder: 0.02 lr_encoder: 0.02 lr_pow: 0.9 num_epoch: 30 optim: SGD seed: 304 start_epoch: 0 weight_decay: 0.0001 workers: 16 VAL: batch_size: 1 checkpoint: epoch_30.pth visualize: False Traceback (most recent call last): File "test.py", line 185, in <module> os.path.exists(cfg.MODEL.weights_decoder), "checkpoint does not exitst!" AssertionError: checkpoint does not exitst!

adityashrm21 commented 4 years ago

@KowalskiWang Did you download the weights for the encoder and the decoder for the HRNet? It seems like the files are missing.

hangzhaomit commented 4 years ago

Can you try to print the directory you are loading from?