wuhuikai / DeepGuidedFilter

Official Implementation of Fast End-to-End Trainable Guided Filter, CVPR 2018

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: Error(s) in loading state_dict for network_dss:

nanjingzhouyu opened this issue · comments

When I use pretrained model on Saliency Detection with DSS, it shows:
RuntimeError: Error(s) in loading state_dict for network_dss:
Unexpected key(s) in state_dict: "guided_map_conv1.weight", "guided_map_conv1.bias", "guided_map_conv2.weight", "guided_map_conv2.bias".

My environment is windows10. Could you help me?

Traceback (most recent call last):
File "D:/DeepGuidedFilter_master/ComputerVision/Saliency_DSS/predict.py", line 49, in
netG.load_state_dict(torch.load(opt.netG))
File "C:\Users\86187\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 830, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for network_dss:
Unexpected key(s) in state_dict: "guided_map_conv1.weight", "guided_map_conv1.bias", "guided_map_conv2.weight", "guided_map_conv2.bias".

Could you show me the command line ?

Could you show me the command line ?
I can not run this command in cmd, so I just ran it on pycharm and it shows the error I mentioned above.

Here is the command line error
(base) D:\DeepGuidedFilter_master\ComputerVision>python predict.py --im_path D:\DeepGuidedFilter_master\images\saliency.jpg --netG D:\DeepGuidedFilter_master\ComputerVision\Saliency_DSS\dss_latest.pth --thres [-1|161] --dgf --nn_dgf --post_sigmoid --cuda
'161]' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

(base) D:\DeepGuidedFilter_master\ComputerVision>

Please run this python predict.py --im_path D:\DeepGuidedFilter_master\images\saliency.jpg --netG D:\DeepGuidedFilter_master\ComputerVision\Saliency_DSS\dss_latest.pth --thres 161 --dgf --nn_dgf --post_sigmoid --cuda

Thank you so much, It works