Closed Xiaoqi-Zhao-DLUT closed 4 months ago
@Cralence Thanks, can you open the permission for your updated weights (google drive)
Hmm I think it would work now?
Faced with issue during running inference.py
Oh I think that you have entered the path to the checkpoint of the backbone encoder
I have downloaded the PVT v2-B5 weights (that you provide) and put the path to this .pth file. Do I need to have both - model weights and backbone weights?
Are you going to share model weights? I hope you are going to)
Hmm maybe the readme file is a bit confusing. You just downloaded the pretrained backbone (i.e., the weight for PVT b5). For doing inference, you need to click the "4.19" hyperlink to download the weight for the whole model.
Hi, I am getting an issue with loading the model weights as well.
I ran python infer.py --dataset SBU --ckpt ./model/PVTb5_SBU.pth
and got this error:
Traceback (most recent call last):
File "infer.py", line 179, in <module>
main(args_from_parser)
File "infer.py", line 44, in main
net = Network(
File "/home/hanlinm2/SILT/model/network.py", line 288, in __init__
self.encoder.load_state_dict(torch.load(backbone_ckpt))
File "/home/hanlinm2/miniconda3/envs/silt/lib/python3.8/site-packages/torch/serialization.py", line 579, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/hanlinm2/miniconda3/envs/silt/lib/python3.8/site-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/hanlinm2/miniconda3/envs/silt/lib/python3.8/site-packages/torch/serialization.py", line 211, in __init__
super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/home/wangty/Projects/Shadow/shadow_detection/SILT_v1/model/backbone/PVT/pvt_v2_b5.pth'
I printed out the backbone=args_model['training_config']['backbone'],
and backbone_ckpt=args_model['pretrained_encoder_dir'][args_model['training_config']['backbone']]
and it printed PVT-b5
and /home/wangty/Projects/Shadow/shadow_detection/SILT_v1/model/backbone/PVT/pvt_v2_b5.pth
I think this absolute path is saved into the .pth
files, which has a different path than my file set up.
@hanlinm2 Oh that's my problem. I've fixed that. Try it now?
Thanks for your interest, and we will provide those in a few days.