Tramac / awesome-semantic-segmentation-pytorch

Semantic Segmentation on PyTorch (include FCN, PSPNet, Deeplabv3, Deeplabv3+, DANet, DenseASPP, BiSeNet, EncNet, DUNet, ICNet, ENet, OCNet, CCNet, PSANet, CGNet, ESPNet, LEDNet, DFANet)
Apache License 2.0
2.8k stars 581 forks source link

I trained the model and I have weights file. But error while evaluating. #154

Closed GutlapalliNikhil closed 3 years ago

GutlapalliNikhil commented 3 years ago

Hi people.

I have trained the model and I have weights file. Now I need to evaluate the files.

I tried the command, "python eval.py --model fcn32s --backbone vgg16 --dataset sbu".

Then I got the error like, .

./datasets/shadow/SBU-Test/ShadowImages Found 4 images in the folder ../datasets/shadow/SBU-Test/ShadowImages Traceback (most recent call last): File "eval.py", line 113, in evaluator = Evaluator(args) File "eval.py", line 51, in init norm_layer=BatchNorm2d).to(self.device) File "/content/awesome-semantic-segmentation-pytorch/core/models/model_zoo.py", line 122, in get_segmentation_model return modelsmodel File "/content/awesome-semantic-segmentation-pytorch/core/models/fcn.py", line 165, in get_fcn32s model.load_state_dict(torch.load(get_modelfile('fcn32s%s_%s' % (backbone, acronyms[dataset]), root=root), KeyError: 'sbu'

I am not able to find how to upload the .PTH file in the eval.py. Could someone help me in this? Thank you guys.

Tramac commented 3 years ago

Please add'sbu': 'sbu'at here.

GutlapalliNikhil commented 3 years ago

Thanks @Tramac